Part Number Hot Search : 
EP100 001118 AM687LMB FDS66 SY89834U SUH230 MAC04057 SD840
Product Description
Full Text Search
 

To Download ST72754 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  october 2003 1/144 st72774/ST72754/st72734 8-bit usb mcu for monitors, with up to 60k otp, 1k ram, adc, timer, sync, tmu, pwm/brm, h/w ddc & i 2 c n user rom/otp/eprom: up to 60 kbytes n data ram: up to 1 kbytes (256 bytes stack) n 8 mhz internal clock frequency in fast mode, 4 mhz in normal mode n run and wait cpu modes n system protection against illegal address jumps and illegal opcode execution n sync processor for mode recognition, power management and composite video blanking, clamping and free-running frequency generation C corrector mode C analyzer mode n usb (universal serial bus) for monitor function 1 C three endpoints C integrated 3.3v voltage regulator C transceiver C suspend and resume operations n timing measurement unit (tmu) for autoposition and autosize 1 n fast i 2 c single master interface n ddc bus interface with: C ddc1/2b protocol implemented in hardware C programmable ddc ci modes C enhanced ddc (eddc) address decoding n 31 i/o lines n 2 lines programmable as interrupt inputs n 16-bit timer with 2 input captures and 2 output compare functions n 8-bit analog to digital converter with 4 channels on port b n 8 10-bit pwm/brm digital to analog outputs n master reset and low voltage detector (lvd) reset n programmable watchdog for system reliability n fully static operation n 63 basic instructions / 17 main addressing modes n 8x8 unsigned multiply instruction n true bit manipulation n complete development support on pc/dos- windows: real-time emulator, eprom programming board and gang programmer n full software package (assembler, linker, c- compiler, source level debugger) device summary (1) on some devices only, refer to device summary; (2) contact sales office for availability (3) 8-bit 2 lsb a/d converter ; (4) 8-bit 4 lsb a/d converter. tqfp44 10 x 10 psdip42 features st72(t/e)774(j/s)9 st72(t)754(j/s)9 st72774(j/s)7 ST72754(j/s)7 st72(t/e)734j6 program memory - bytes 60k 48k 32k ram (stack) - bytes 1k (256) 512 (256) peripherals usb no usb usb no usb no usb adc 3 , 16-bit timer, i 2 c, ddc, tmu,sync, pwm, lvd, watchdog adc 4 , i 2 c,lvd, ddc,sync, 16-bit timer, pwm, watchdog operating supply 4.0v to 5.5v supply operating range oscillator frequency 12 or 24 mhz operating temperature 0 to +70c package csdip42 or psdip42 or tqfp44 psdip42 csdip42 1
table of contents 4 2/144 1 general description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 1.1 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 1.2 pin description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 1.3 memory map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 1.4 external connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 2 central processing unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 2.1 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 2.2 main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 2.3 cpu registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 3 clocks, reset, interrupts & low power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 3.1 clock system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 3.1.1 general description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 3.1.2 crystal resonator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 3.1.3 external clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 3.2 reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 3.2.1 lvd and watchdog reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 3.2.2 external reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 0 3.2.3 illegal address detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 3.2.4 illegal opcode detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 3.3 interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 3.4 power saving modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 3.4.1 wait mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 5 3.4.2 halt mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 5 3.5 miscellaneous register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 4 on-chip peripherals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 4.1 i/o ports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 4.1.1 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 4.1.2 common functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 4.1.3 port a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 4.1.4 port b . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 4.1.5 port c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 4.1.6 port d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 4.1.7 register description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 4.2 watchdog timer (wdg) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 4.2.1 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 4.2.2 main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 9 4.2.3 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 4.2.4 interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 4.2.5 register description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 4.3 16-bit timer (tim) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 4.3.1 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 4.3.2 main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 1 4.3.3 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 4.3.4 register description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 4.4 sync processor (sync) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 2
st72774/st727754/st72734 3/144 4.4.1 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 4.4.2 main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 6 4.4.3 input signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 4.4.4 input signal waveforms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 4.4.5 output signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 7 4.4.6 input processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 4.4.7 output processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 4.4.8 analyzer mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 4.4.9 corrector mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 4.4.10register description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 4.5 timing measurement unit (tmu) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 4.5.1 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 4.5.2 main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 5 4.5.3 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 4.5.4 register description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 4.6 usb interface (usb) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 4.6.1 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 4.6.2 main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 9 4.6.3 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 4.6.4 register description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 4.6.5 programming considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 4.7 i2c single master bus interface (i2c) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 4.7.1 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 4.7.2 main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 7 4.7.3 general description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 4.7.4 functional description (master mode) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 4.7.5 register description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 4.8 ddc interface (ddc) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 4.8.1 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 4.8.2 ddc interface features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 4.8.3 signal description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97 4.8.4 i2c bus protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98 4.8.5 ddc standard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 4.8.6 register description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110 4.9 pwm/brm generator (dac) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 4.9.1 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 4.9.2 main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 4.9.3 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 4.9.4 register description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121 4.10 8-bit a/d converter (adc) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 4.10.1introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 4.10.2main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 3 4.10.3functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 4.10.4low power mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124 4.10.5interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124 4.10.6register description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125 5 instruction set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126 5.1 st7 addressing modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
st72774/st727754/st72734 4/144 5.1.1 inherent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127 5.1.2 immediate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 27 5.1.3 direct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127 5.1.4 indexed (no offset, short, long) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127 5.1.5 indirect (short, long) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127 5.1.6 indirect indexed (short, long) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128 5.1.7 relative mode (direct, indirect) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128 5.2 instruction groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129 6 electrical characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132 6.1 power considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133 6.2 ac/dc electrical characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134 7 general information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 39 7.1 package mechanical data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139 8 ordering information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 1 8.1 transfer of customer code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
st72774/st727754/st72734 5/144 revision follow-up changes applied since version 4.0 version 4.0 march 2001 page 1:addition of 72t774 (32kotp). addition of 60k/48k rom for ST72754 deletion of table device summary, replaced with cross reference to table 36 on page 147. page 13 - addition of section 1.4. external connections version 4.1 july 2001 initial format reapplied, text and related figures in the same page. table device summary reinserted in cover page and updated. update of table 36: ordering information (p143) version 4.2 july 2001 cover - addition of feature about system protection added, table for device summary: addition of stack values page 9 - figure 3: replaced 1kbyte with 512 bytes + notes about opcode fetch and halt mode page 10 - table: cr replaced by wdgcr tim replaced with timer and wdg replaced with watchdog page 115 - edf register: addition of read from ram, ede: few changes page 135 - note 1 replaced, note 2 added suspend mode limitation.. whole document: all mentions of halt mode either deleted or rewritten. version 4.3 october 2001 p140, chapter 8, section 8.1- code for unused bytes ( ffh) replaced with 9dh (opcode for nop) page 141- update of table 36 ordering information page 142 - list of available devices updated page 114 - ddc dcr register: bit 5 = 1, text or read from ram deleted version 4.3 november 2001 page 10, one adddress corrected in the figure 3 memory map: 0400h page 14: addition of mandatory 1k resistor (text and figure) 3
st72774/st727754/st72734 6/144 1 general description 1.1 introduction the st72774, ST72754 and st72734 are hcmos microcontroller units (mcu) from the st727x4 family with dedicated peripherals for monitor applications. they are based around an industry standard 8-bit core and offer an enhanced instruction set. the processor runs with an external clock at 12 or 24 mhz with a 5v supply. due to the fully static design of this device, operation down to dc is possible. under software control the st727x4 can be placed in wait mode thus reducing power consumption. the halt mode is no longer available. the enhanced instruction set and addressing modes afford real programming potential. illegal opcodes are patched and lead to a reset. in addition to standard 8-bit data management the st7 features true bit manipulation, 8x8 unsigned multiplication and indirect addressing modes. the device includes an on-chip oscillator, cpu, system protection against illegal address jumps, sync processor for video timing & vfback analysis, up to 60k program memory, up to 1k ram, usb/ dma, a timing measurement unit, i/o, a timer with 2 input captures and 2 output compares, a 4- channel analog to digital converter, ddc, i 2 c single master, watchdog reset, and eight 10-bit pwm/brm outputs for analog dc control of external functions. figure 1. st727x4 block diagram address and data bus v ss oscin oscout reset adc ddc port c port d dac (pwm) osc v dd ram port b port a pa1 pb6-pb7/ain2-ain3/pwm1-pwm2 pb3/sdai pb2/scli pb1/sdad pb0/scld pc1/av pd6/clampout power supply pb4-pb5/ain0-ain1 8-bit core alu control watchdog mode selection : 3 rom/otp/eprom up to 60k bytes up to 1k bytes hsynci vsynci i2c usbvcc sync processor pc0/hsyncdiv pc2-pc7/pwm3-pwm8 pa2/vsynci2 timer pa0/ocmp1 tmu pd1/hsynco pd3/ita/vfback pd4/itb pd5/hfback pd0/vsynco pd2/csynci usb usbdp usbdm pa3-pa6 pa7/blankout 3
st72774/st727754/st72734 7/144 1.2 pin description figure 2. 44-pin tqfp and 42-pin sdip package pinouts vsynco / pd0 hsynco / pd1 csynci / pd2 vfback / ita /pd3 itb / pd4 hfback / pd5 clampout / pd6 scld / pb0 v ss hsynci vsynci 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 ain1 / pb5 ain0 / pb4 nc v dd usbvcc usbdm usbdp pwm7 / pc6 pwm8 / pc7 pwm2 / ain3 / pb7 pwm1 / ain2 / pb6 oscin oscout pa7 / blankout pb3 / sdai pb2 / scli pb1 / sdad nc pa3 pa4 pa5 pa6 pc1 / av pc0 / hsyncdiv pa0 / ocmp1 test / v pp reset pa1 pa2/vsynci2 pc5 / pwm6 pc4 / pwm5 pc3 / pwm4 pc2 / pwm3 38 37 36 35 34 33 32 31 30 29 28 27 16 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 39 40 41 42 hsyncdiv / pc0 av / pc1 usbdp usbdm usbvcc v dd ain0 / pb4 ain1 / pb5 pwm1 / ain2 / pb6 pwm7 / pc6 pwm6 / pc5 pwm5 / pc4 pwm4 / pc3 pwm3 / pc2 pwm2 / ain3 / pb7 pwm8 / pc7 pa0 / ocmp1 test / v pp pb0 / scld pb1 / sdad pb2 / scli pb3 / sdai pa7 / blankout oscout oscin pa4 pa3 pa2/vsynci2 pa1 reset pa5 pa6 21 20 17 18 19 hsynco / pd1 vsynco / pd0 vsynci hsynci v ss 26 25 24 23 22 pd2 / csynci pd3 / ita / vfback pd4 / itb pd5 / hfback pd6 / clampout nc = not connected 3
st72774/st727754/st72734 8/144 pin description (contd) reset: bidirectional. this active low signal forces the initialization of the mcu. this event is the top priority non maskable interrupt. this pin is switched low when the watchdog has triggered or v dd is low. it can be used to reset external peripherals. oscin/oscout: input/output oscillator pin. these pins connect a parallel-resonant crystal, or an external source to the on-chip oscillator. test/v pp : input. eprom programming voltage. this pin must be held low during normal operating modes. v dd : power supply voltage (4.0v-5.5v) v ss : digital ground. alternate functions : several pins of the i/o ports assume software programmable alternate functions as shown in the pin description table 1. st727x4 pin description pin no. pin name type description remarks tqfp44 sdip42 39 1 pc0/hsyncdiv i/o port c0 or hsyncdiv output (hsynco divided by 2) 40 2 pc1/av i/o port c1 or active video input 41 3 pc2/pwm3 i/o port c2 or 10-bit pwm/brm output 3 for analog controls, after external filtering 42 4 pc3/pwm4 i/o port c3 or 10-bit pwm/brm output 4 43 5 pc4/pwm5 i/o port c4 or 10-bit pwm/brm output5 44 6 pc5/pwm6 i/o port c5 or 10-bit pwm/brm output 6 1 7 pc6/pwm7 i/o port c6 or 10-bit pwm/brm output 7 2 8 pc7/pwm8 i/o port c7 or 10-bit pwm/brm output 8 3 9 pb7/ain3/pwm2 i/o port b7 or adc analog input 3 or 10-bit pwm/brm output 2 4 10 pb6/ain2/pwm1 i/o port b6 or adc analog input 2 or 10-bit pwm/brm output 1 5 11 pb5/ain1 i/o port b5 or adc analog input 1 6 12 pb4/ain0 i/o port b4 or adc analog input 0 813v dd s supply (4.0v - 5.5v) 9 14 usbvcc s usb power supply (output 3.3v +/- 10%) 10 15 usbdm i/o usb bidirectional data must be tied to ground for devices without usb peripheral 11 16 usbdp i/o usb bidirectional data 12 17 v ss s ground 0v 13 18 hsynci i sync horizontal synchronisation input ttl levels refer to figure 16 14 19 vsynci i sync vertical synchronisation input 15 20 pd0/vsynco i/o port d0 or sync vertical synchronisation output 16 21 pd1/hsynco i/o port d1 or sync horizontal synchronisation output 17 22 pd2/csynci i/o port d2 or sync composite synchronisation input ttl levels with pull-up (sync input) 3
st72774/st727754/st72734 9/144 18 23 pd3/vfback/ita i/o port d3 or sync vertical flyback input or interrupt fall- ing edge detector input a refer to figure 16 and table 11 port d de- scription 19 24 pd4/itb i/o port d4 or interrupt falling edge detector input b refer to table 11 port d description 20 25 pd5/hfback i/o port d5 or sync horizontal flyback input ttl levels with pull-up (sync input) 21 26 pd6/clampout i/o port d6 or sync clamping/ moire output 22 27 pb0/scld i/o port b0 or ddc serial clock 24 28 pb1/sdad i/o port b1 or ddc serial data 25 29 pb2/scli i/o port b2 or i2c serial clock 26 30 pb3/sdai i/o port b3 or i2c serial data 27 31 pa7/blankout i/o port a7 or sync blanking output 28 32 oscout o oscillator output 29 33 oscin i oscillator input 30 34 pa6 i/o port a6 31 35 pa5 i/o port a5 32 36 pa4 i/o port a4 33 37 pa3 i/o port a3 34 38 pa2/vsynci2 i/o port a2 or sync vertical synchronisation input 2 ddc1 only 35 39 pa1 i/o port a1 36 40 reset i/o reset pin active low 37 41 test/v pp s test mode pin or eprom programming voltage. this pin should be tied low in user mode. 38 42 pa0/ocmp1 i/o port a0 or timer output compare 1 pin no. pin name type description remarks tqfp44 sdip42
st72774/st727754/st72734 10/144 1.3 memory map figure 3. memory map 0000h hw registers 03ffh 0060h 005fh 0400h reserved ffe0h ffffh 1000h 0fffh 60 kbytes short addressing ram (zero page) 0060h 0100h 01ffh 256 bytes stack/ 16-bit addressing ram 1 kbyte ram 32 kbytes 4000h ffdfh 48 kbytes 8000h rom/eprom 512 bytes ram short addressing ram (zero page) 16-bit addressing 0060h 03ffh 0100h 01ffh 0200h 256 bytes stack/ 16-bit addressing ram ram 512 bytes (see table 2 ) interrupt & reset vectors * (see table 3 ) any opcode fetch in those areas is considered as illegal and generates a reset (*) this block only contains addresses of interrupts and reset routines, no opcode is run from this block
st72774/st727754/st72734 11/144 memory map (contd) table 2. hardware register memory map address block register label register name reset status remarks 0000h 0001h padr paddr port a data register port a data direction register 00h 00h r/w r/w 0002h 0003h pbdr pbddr port b data register port b data direction register 00h 00h r/w r/w 0004h 0005h pcdr pcddr port c data register port c data direction register 00h 00h r/w r/w 0006h 0007h pddr pdddr port d data register port d data direction register 00h 00h r/w r/w 0008h watchdog wdgcr watchdog control register 7fh r/w 0009h miscr miscellaneous register 10h r/w 000ah 000bh adc adcdr adccsr adc data register adc control status register 00h 00h read only r/w 000ch 000dh ddc1/2b ddcdcr ddcahr ddc1/2b control register ddc1/2b address pointer high register 00h xxh r/w r/w 000eh 000fh 00010h tmu tmucsr tmut1cr tmut2cr tmu control status register tmu t1 counter register tmu t2 counter register fch ffh ffh r/w read only read only 0011h 0012h 0013h 0014h 0015h 0016h 0017h 0018h 0019h 001ah 001bh 001ch 001dh 001eh 001fh timer timcr2 timcr1 timsr timic1hr timic1lr timoc1hr timoc1lr timchr timclr timachr timaclr timic2hr timic2lr timoc2hr timoc2lr timer control register 2 timer control register 1 timer status register timer input capture 1 high register timer input capture 1 low register timer output compare 1 high register timer output compare 1 low register timer counter high register timer counter low register timer alternate counter high register timer alternate counter low register timer input capture 2 high register timer input capture 2 low register timer output compare 2 high register timer output compare 2 low register 00h 00h 00h xxh xxh 80h 00h ffh fch ffh fch xxh xxh 80h 00h r/w r/w read only read only read only r/w r/w read only r/w read only r/w read only read only r/w r/w 0020h to 0024h reserved area (5 bytes)
st72774/st727754/st72734 12/144 0025h 0026h 0027h 0028h 0029h 002ah 002bh 002ch 002dh 002eh 002fh 0030h 0031h usb usbpidr usbdmar usbidr usbistr usbimr usbctlr usbdaddr usbep0ra usbep0rb usbep1ra usbep1rb usbep2ra usbep2rb usb pid register usb dma address register usb interrupt/dma register usb interrupt status register usb interrupt mask register usb control register usb device address register usb endpoint 0 register a usb endpoint 0 register b usb endpoint 1 register a usb endpoint 1 register b usb endpoint 2 register a usb endpoint2 register b xxh xxh xxh 00h 00h xxxx 0110 00h 0000 xxxx 80h 0000 xxxx 0000 xxxx0000 0000 xxxx0000 read only r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w 0032h 0033h 0034h 0035h 0036h 0037h 0038h 0039h 003ah 003bh 003ch 003dh 003eh pwm pwm1 brm21 pwm2 pwm3 brm43 pwm4 pwm5 brm65 pwm6 pwm7 brm87 pwm8 pwmcr 10 bit pwm / brm pwm output enable register 80h 00h 80h 80h 00h 80h 80h 00h 80h 80h 00h 80h 00h r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w 003fh reserved area (1 byte) 0040h 0041h 0042h 0043h 0044h 0045h 0046h 0047h sync synccfgr syncmcr syncccr syncpolr synclatr synchgenr syncvgenr syncenr sync configuration register sync multiplexer register sync counter register sync polarity register sync latch register sync h sync generator register sync v sync generator register sync processor enable register 00h 20h 00h 08h 00h 00h 00h c3h r/w r/w r/w r/w r/w r/w r/w r/w 0048h to 004fh reserved area (8 bytes) address block register label register name reset status remarks
st72774/st727754/st72734 13/144 table 3. interrupt vector map 0050h 0051h 0052h 0053h 0054h 0055h 0056h ddc/ci ddccr ddcsr1 ddcsr2 ddcoar ddcdr ddc/ci control register ddc/ci status register 1 ddc/ci status register 2 reserved ddc/ci (7 bits) slave address register reserved ddc/ci data register 00h 00h 00h 00h 00h r/w read only read only r/w r/w 0057h 0058h reserved area (2 bytes) 0059h 005ah 005bh 005ch 005dh 005eh 005fh i2c i2cdr i2cccr i2csr2 i2csr1 i2ccr i2c data register reserved reserved i 2 c clock control register i 2 c status register 2 i 2 c status register 1 i 2 c control register 00h 00h 00h 00h 00h r/w r/w read only read only r/w vector address description remarks ffe0-ffe1h ffe2-ffe3h ffe4-ffe5h ffe6-ffe7h ffe8-ffe9h ffea-ffebh ffec-ffedh ffee-ffefh fff0-fff1h fff2-fff3h fff4-fff5h fff6-fff7h fff8-fff9h fffa-fffbh fffc-fffdh fffe-ffffh not used not used not used usb interrupt vector not used i2c interrupt vector timer overflow interrupt vector timer output compare interrupt vector timer input capture interrupt vector ita falling edge interrupt vector itb falling edge interrupt vector ddc1/2b interrupt vector ddc/ci interrupt vector usb end suspend interrupt vector trap (software) interrupt vector reset vector internal interrupts external interrupts internal interrupt cpu interrupt address block register label register name reset status remarks
st72774/st727754/st72734 14/144 1.4 external connections the following figure shows the recommended ex- ternal connections for the device. the v pp pin is only used for programming otp and eprom devices and must be tied to ground in user mode. the 10 nf and 0.1 f decoupling capacitors on the power supply lines are a suggested emc per- formance/cost tradeoff. the external reset network (including the manda- tory 1k serial resistor) is intended to protect the device against parasitic resets, especially in noisy environments. unused i/os should be tied high to avoid any un- necessary power consumption on floating lines. an alternative solution is to program the unused ports as inputs with pull-up. figure 4. recommended external connections v pp v dd v ss oscin oscout reset v dd 0.1f + see clocks section v dd 0.1f 0.1f external reset circuit or configure unused i/o ports unused i/o 10nf 4.7k 10k by software as input with pull-up v dd 1k
st72774/st727754/st72734 15/144 2 central processing unit 2.1 introduction this cpu has a full 8-bit architecture and contains six internal registers allowing efficient 8-bit data manipulation. 2.2 main features n 63 basic instructions n fast 8-bit by 8-bit multiply n 17 main addressing modes n two 8-bit index registers n 16-bit stack pointer n low power modes n maskable hardware interrupts n non-maskable software interrupt 2.3 cpu registers the 6 cpu registers shown in figure 5 are not present in the memory mapping and are accessed by specific instructions. accumulator (a) the accumulator is an 8-bit general purpose register used to hold operands and the results of the arithmetic and logic calculations and to manipulate data. index registers (x and y) in indexed addressing modes, these 8-bit registers are used to create either effective addresses or temporary storage areas for data manipulation. (the cross-assembler generates a precede instruction (pre) to indicate that the following instruction refers to the y register.) the y register is not affected by the interrupt automatic procedures (not pushed to and popped from the stack). program counter (pc) the program counter is a 16-bit register containing the address of the next instruction to be executed by the cpu. it is made of two 8-bit registers pcl (program counter low which is the lsb) and pch (program counter high which is the msb). figure 5. cpu registers accumulator x index register y index register stack pointer condition code register program counter 70 1c 11hi nz reset value = reset vector @ fffeh-ffffh 70 70 70 0 7 15 8 pch pcl 15 8 70 reset value = stack higher address reset value = 1x 11x1xx reset value = xxh reset value = xxh reset value = xxh x = undefined value
st72774/st727754/st72734 16/144 cpu registers (contd) condition code register (cc) read/write reset value: 111x1xxx the 8-bit condition code register contains the interrupt mask and four flags representative of the result of the instruction just executed. this register can also be handled by the push and pop instructions. these bits can be individually tested and/or controlled by specific instructions. bit 4 = h half carry . this bit is set by hardware when a carry occurs between bits 3 and 4 of the alu during an add or adc instruction. it is reset by hardware during the same instructions. 0: no half carry has occurred. 1: a half carry has occurred. this bit is tested using the jrh or jrnh instruction. the h bit is useful in bcd arithmetic subroutines. bit 3 = i interrupt mask . this bit is set by hardware when entering in interrupt or by software to disable all interrupts except the trap software interrupt. this bit is cleared by software. 0: interrupts are enabled. 1: interrupts are disabled. this bit is controlled by the rim, sim and iret instructions and is tested by the jrm and jrnm instructions. note: interrupts requested while i is set are latched and can be processed when i is cleared. by default an interrupt routine is not interruptable because the i bit is set by hardware when you enter it and reset by the iret instruction at the end of the interrupt routine. if the i bit is cleared by software in the interrupt routine, pending interrupts are serviced regardless of the priority level of the current interrupt routine. bit 2 = n negative . this bit is set and cleared by hardware. it is representative of the result sign of the last arithmetic, logical or data manipulation. it is a copy of the 7 th bit of the result. 0: the result of the last operation is positive or null. 1: the result of the last operation is negative (i.e. the most significant bit is a logic 1). this bit is accessed by the jrmi and jrpl instructions. bit 1 = z zero . this bit is set and cleared by hardware. this bit indicates that the result of the last arithmetic, logical or data manipulation is zero. 0: the result of the last operation is different from zero. 1: the result of the last operation is zero. this bit is accessed by the jreq and jrne test instructions. bit 0 = c carry/borrow. this bit is set and cleared by hardware and software. it indicates an overflow or an underflow has occurred during the last arithmetic operation. 0: no overflow or underflow has occurred. 1: an overflow or underflow has occurred. this bit is driven by the scf and rcf instructions and tested by the jrc and jrnc instructions. it is also affected by the bit test and branch, shift and rotate instructions. 70 111hinzc
st72774/st727754/st72734 17/144 cpu registers (contd) stack pointer (sp) read/write reset value: 01 ffh the stack pointer is a 16-bit register which is always pointing to the next free location in the stack. it is then decremented after data has been pushed onto the stack and incremented before data is popped from the stack (see figure 6 ). since the stack is 256 bytes deep, the most significant byte is forced by hardware. following an mcu reset, or after a reset stack pointer instruction (rsp), the stack pointer contains its reset value (the sp7 to sp0 bits are set) which is the stack higher address. the least significant byte of the stack pointer (called s) can be directly accessed by a ld instruction. note: when the lower limit is exceeded, the stack pointer wraps around to the stack upper limit, without indicating the stack overflow. the previously stored information is then overwritten and therefore lost. the stack also wraps in case of an underflow. the stack is used to save the return address during a subroutine call and the cpu context during an interrupt. the user may also directly manipulate the stack by means of the push and pop instructions. in the case of an interrupt, the pcl is stored at the first location pointed to by the sp. then the other registers are stored in the next locations as shown in figure 6 . C when an interrupt is received, the sp is decre- mented and the context is pushed on the stack. C on return from interrupt, the sp is incremented and the context is popped from the stack. a subroutine call occupies two locations and an interrupt five locations in the stack area. figure 6. stack manipulation example 15 8 00000001 70 sp7 sp6 sp5 sp4 sp3 sp2 sp1 sp0 pch pcl sp pch pcl sp pcl pch x a cc pch pcl sp pcl pch x a cc pch pcl sp pcl pch x a cc pch pcl sp sp y call subroutine interrupt event push y pop y iret ret or rsp @ 01ffh @ 0100h stack higher address = 01ffh stack lower address = 0100h
st72774/st727754/st72734 18/144 3 clocks, reset, interrupts & low power modes 3.1 clock system 3.1.1 general description the mcu accepts either a crystal or an external clock signal to drive the internal oscillator. the internal clock (cpu clk running at f cpu ) is derived from the external oscillator frequency (f osc ), which is divided by 3. depending on the external quartz or clock frequency, a division factor of 2 is optionally added to generate the 12 mhz clock for the sync processor (clamp function) as shown in figure 7 and a second divider by 2 for the 6mhz usb clock. the cpu clock is used also as clock for the st727x4 peripherals. note : in the sync processor, an additional divider by two is added in fast mode (same external timing for this peripheral). figure 7. clock divider chain %3 12 mhz (sync processor clampout signal) f cpu : 4 or 8 mhz (cpu and peripherals) osc 12 mhz %2 fast or 24mhz fast=1 for 24mhz oscillator fast=0 for 12 mhz oscillator %2 6 mhz (usb) 12 mhz or 24mhz (tmu) 4
st72774/st727754/st72734 19/144 clock system (contd) 3.1.2 crystal resonator the internal oscillator is designed to operate with an at-cut parallel resonant quartz crystal resonator in the frequency range specified for f osc . the circuit shown in figure 8 is recommended when using a crystal, and table 4, . recommended crystal values, on page 19 lists the recommended capacitance and feedback resistance values. the crystal and associated components should be mounted as close as possible to the input pins in order to minimize output distortion and start-up stabilization time. figure 8. crystal/ceramic resonator table 4 . recommended crysta l values legend: c l1 , c l2 = maximum total capacitance on pins oscin and oscout (the value includes the external capacitance tied to the pin plus the parasitic capacitance of the board and of the device). r smax = maximum series parasitic resistance of the quartz allowed. note: the tables are relative to the quartz crystal only (not ceramic resonator). 3.1.3 external clock an external clock should be applied to the oscin input with the oscout pin not connected as shown in figure 9 . the crystal clock specifications do not apply when using an external clock input. the equivalent specification of the external clock source should be used. figure 9. external clock source connections oscin oscout c l1 c l2 crystal clock 1m* *recommended for oscillator stability 24 mhz unit r smax 70 25 20 ohms c l1 22 47 56 pf c l2 22 47 56 pf oscin oscout external clock nc
st72774/st727754/st72734 20/144 3.2 reset the reset procedure is used to provide an orderly software start-up or to quit low power modes. five conditions generate a reset: n lvd, n watchdog, n external pulse at the reset pin, n illegal address, n illegal opcode. a reset causes the reset vector to be fetched from addresses fffeh and ffffh in order to be loaded into the pc and with program execution starting from this point. an internal circuitry provides a 4096 cpu clock cycle delay from the time that the oscillator becomes active. 3.2.1 lvd and watchdog reset the low voltage detector (lvd) generates a reset when v dd is below v trh when v dd is rising or v trl when vdd is falling (refer to figure 11 ). this circuitry is active only when v dd is above v trm. during lvd reset, the reset pin is held low, thus permitting the mcu to reset other devices. when a watchdog reset occurs, the reset pin is pulled low permitting the mcu to reset other devices as when power on/off ( figure 10 ). 3.2.2 external reset the external reset is an active low input signal applied to the reset pin of the mcu. as shown in figure 12 , the reset signal must remain low for 1000ns. an internal schmitt trigger at the reset pin is provided to improve noise immunity. 3.2.3 illegal address detection an opcode fetch from an illegal address (refer to figure 3 ) generates an illegal address reset. program execution at those addresses is forbidden (especially to protect page 0 registers against spurious accesses). 3.2.4 illegal opcode detection illegal instructions corresponding to no valid opcode generate a reset. refer to st7 programming manual. table 5. list of sections affected by reset and wait (refer to 3.6 for wait mode) section reset wait fast bit of the miscellaneous register set to one (24 mhz as external clock) x timer prescaler reset to zero x timer counter set to fffch x all timer enable bits set to 0 (disabled) x data direction registers set to 0 (as inputs) x set stack pointer to 01ffh x force internal address bus to restart vector fffeh, ffffh x set interrupt mask bit (i-bit, cc) to 1 (interrupt disable) x set interrupt mask bit (i-bit, cc) to 0 (interrupt enable) x reset wait latch x disable oscillator (for 4096 cycles) x set timer clock to 0 x watchdog counter reset x watchdog register reset x port data registers reset x other on-chip peripherals: registers reset x
st72774/st727754/st72734 21/144 reset (contd) figure 10. low voltage detector functional diagram figure 11. lvd reset signal output note: see electrical characteristics section for values of v trh, v trl and v trm figure 12. reset timing diagram note: refer to electrical characteristics for values of t ddr , t oxov and t rl lvd reset respof v dd from watchdog reset reset internal reset v dd v trh v trl v trm v trm v dd oscin f cpu ffff fffe pc reset watchdog reset t ddr t oxov 4096 cpu clock cycles delay t rl
st72774/st727754/st72734 22/144 3.3 interrupts the st727x4 may be interrupted by one of two different methods: maskable hardware interrupts as listed in table 6 and a non-maskable software interrupt (trap). the interrupt processing flowchart is shown in figure 13 . the maskable interrupts must be enabled in order to be serviced. however, disabled interrupts can be latched and processed when they are enabled. when an interrupt has to be serviced, the pc, x, a and cc registers are saved onto the stack and the interrupt mask (i bit of the condition code register) is set to prevent additional interrupts. the y register is not automatically saved. the pc is then loaded with the interrupt vector of the interrupt to service and the interrupt service routine runs (refer to table 6, interrupt mapping, on page 24 for vector addresses). the interrupt service routine should finish with the iret instruction which causes the contents of the registers to be recovered from the stack and normal processing to resume. note that the i bit is then cleared if and only if the corresponding bit stored in the stack is zero. though many interrupts can be simultaneously pending, a priority order is defined (see table 6, interrupt mapping, on page 24). the reset pin has the highest priority. if the i bit is set, only the trap interrupt is enabled. all interrupts allow the processor to leave the wait low power mode. software interrupt. the software interrupt is the executable instruction trap. the interrupt is recognized when the trap instruction is executed, regardless of the state of the i bit. when the interrupt is recognized, it is serviced according to the flowchart on figure 13 . ita, itb interrupts. the ita (pd3), itb (pd4), pins can generate an interrupt when a falling edge occurs on these pins, if these interrupts are enabled with the itaite, itbite bits respectively in the miscellaneous register and the i bit of the cc register is reset. when an enabled interrupt occurs, normal processing is suspended at the end of the current instruction execution. it is then serviced according to the flowchart on figure 13 . software in the ita or itb service routine must reset the cause of this interrupt by clearing the italat, itblat or itaite, itbite bits in the miscellaneous register. peripheral interrupts. different peripheral interrupt flags are able to cause an interrupt when they are active if both the i bit of the cc register is reset and if the corresponding enable bit is set. if either of these conditions is false, the interrupt is latched and thus remains pending. the interrupt flags are located in the status register. the enable bits are in the control register. when an enabled interrupt occurs, normal processing is suspended at the end of the current instruction execution. it is then serviced according to the flowchart on figure 13 . the general sequence for clearing an interrupt is an access to the status register while the flag is set followed by a read or write of an associated register. note that the clearing sequence resets the internal latch. a pending interrupt (i.e. waiting for being enabled) will therefore be lost if the clear sequence is executed.
st72774/st727754/st72734 23/144 interrupts (contd) figure 13. interrupt processing flowchart from reset execute instruction stack pc, x, a, cc set i bit load pc from interrupt vector restore pc, x, a, cc from stack interrupt? n y i bit set? n y iret? fetch next instruction y n this clears i bit by default vr01172d trap? n y
st72774/st727754/st72734 24/144 interrupts (contd) table 6. interrupt mapping ** many flags can cause an interrupt, see peripheral interrupt status register description. source block description register label flag maskable by i-bit vector address priority order reset reset n/a n/a no fffeh-ffffh trap software n/a n/a no fffch-fffdh usb end suspend interrupt usbistr esusp yes fffah-fffbh ddc/ci ddc/ci interrupt ddcsr1 ddcsr2 ** yes fff8h-fff9h ddc1/2b ddc1/2b interrupt ddcdcr edf yes fff6h-fff7h port d bit 4 external interrupt itb miscr itblat yes fff4h-fff5h port d bit 3 external interrupt ita italat yes fff2h-fff3h tim input capture 1 timsr icf1 yes fff0h-fff1h input capture 2 icf2 output compare 1 ocf1 yes ffeeh-ffefh output compare 2 ocf2 timer overflow tof yes ffech-ffedh i2c i2c peripheral inter- rupts i2csr1 i2csr2 ** yes ffeah-ffebh usb usb interrupt usbistr ** yes ffe6h-ffe7h highest priority priority lowest
st72774/st727754/st72734 25/144 3.4 power saving modes 3.4.1 wait mode this mode is a low power consumption mode. the wfi instruction places the mcu in wait mode: the internal clock remains active but all cpu processing is stopped; however, all other peripherals are still running. note: in wait mode, dma accesses (ddc, usb) are possible. during wait mode, the i bit in the condition code register is cleared to enable all interrupts, which causes the mcu to exit wait mode, causes the corresponding interrupt vector to be fetched, the interrupt routine to be executed and normal processing to resume. a reset causes the program counter to fetch the reset vector and processing starts as for a normal reset. table 5 gives a list of the different sections affected by the low power modes. for detailed information on a particular device, please refer to the corresponding part. 3.4.2 halt mode the halt mode is the mcu lowest power consumption mode. meanwhile, the halt mode also stops the oscillator stage completely which is the most critical condition in crt monitors. for this reason, the halt mode has been disabled and its associated halt instruction is now considered as illegal and will generate a reset. figure 14. wait flow chart wfi instruction reset interrupt y n n y cpu clock oscillator periph. clock i-bit on on cleared off cpu clock oscillator periph. clock i-bit on on set on fetch reset vector or service interrupt 4096 cpu clock cycles delay if reset note: before servicing an interrupt, the cc register is pushed on the stack. the i-bit is set during the inter- rupt routine and cleared when the cc register is popped.
st72774/st727754/st72734 26/144 3.5 miscellaneous register miscellaneous register (miscr) address: 0009h read/write reset value: 0001 0000 (10h) bit 7= vsyncsel ddc1 vsync selection. this bit is set and cleared by software. it is used to choose the vsync signal in ddc1 mode. 0: vsynci selected 1: vsynci2 selected note: vsynci 2 is only available for the ddc cell, not for the sync processor cell. bit 6= fly_syn flyback or synchro switch. this bit is set and cleared by software. it is used to choose the signals the timing measurement unit (tmu) will analyse. 0: horizontal and vertical synchro outputs analysis 1: horizontal and vertical flyback inputs analysis bit 5= hsyncdiven hsyncdiv enable. this bit is set and cleared by software. it is used to enable the output of the hsynco output on pc0. 0: hsyncdiv disabled 1:hsyncdiv enabled bit 4= fast fast mode. this bit is set and cleared by software. it is used to select the external clock frequency. if the external clock frequency is 12 mhz, this bit must be at 0, else if the external frequency is 24 mhz, this bit must be at 1. bit 3= itblat falling edge detector latch. this bit is set by hardware when a falling edge occurs on pin itb/pd4 in port d. an interrupt is generated if itbite=1and the i bit in the cc register = 0. it is cleared by software. 0: no falling edge detected on itb 1: falling edge detected on itb bit 2= italat falling edge detector latch. this bit is set by hardware when a falling edge occurs on pin ita/pd3 in port d. an interrupt is generated if itaite=1and the i bit in the cc register = 0. it is cleared by software. 0: no falling edge detected on ita 1: falling edge detected on ita bit 1= itbite itb interrupt enable . this bit is set and cleared by software. 0: itb interrupt disabled 1: itb interrupt enabled bit 0= itaite ita interrupt enable . this bit is set and cleared by software. 0: ita interrupt disabled 1: ita interrupt enabled 70 vsync sel fly_s yn hsync diven fast itblat italat itbite itaite
st72774/st727754/st72734 27/144 4 on-chip peripherals 4.1 i/o ports 4.1.1 introduction the i/o ports allow the transfer of data through digital inputs and outputs, and, for specific pins, the input of analog signals or the input/output of alternate signals for on-chip peripherals (ddc, timer...). each pin can be programmed independently as digital input or digital output. each pin can be an analog input when an analog switch is connected to the analog to digital converter (adc). figure 15. i/o pin typical circuit note: this is the typical i/o pin configuration. for cost optimization, each port is customized with a specific configuration. dr ddr latch latch data bus dr sel ddr sel v dd pad analog switch (if required) analog enable (adc) alternate enable alternate enable digital enable alternate enable common analog rail alternate alternate input pull-up (if required) output p-buffer (if required) n-buffer 1 0 1 0 v ss 5
st72774/st727754/st72734 28/144 i/o ports (contd) table 7. i/o pin functions 4.1.2 common functional description each port pin of the i/o ports can be individually configured under software control as either input or output. each bit of a data direction register (ddr) corresponds to an i/o pin of the associated port. this corresponding bit must be set to configure its associated pin as output and must be cleared to configure its associated pin as input (table 7, . i/o pin functions, on page 28). the data direction registers can be read and written. the typical i/o circuit is shown on figure 15 . any write to an i/o port updates the port data register even if it is configured as input. any read of an i/o port returns either the data latched in the port data register (pins configured as output) or the value of the i/o pins (pins configured as input). remark : when an i/o pin does not exist inside an i/o port, the returned value is a logic one (pin configured as input). at reset, all ddr registers are cleared, which configures all ports i/os as inputs with or without pull-ups (see table 8 to table 12 i/o ports register map ). the data registers (dr) are also initialized at reset. 4.1.2.1 input mode when ddr=0, the corresponding i/o is configured in input mode. in this case, the output buffer is switched off, the state of the i/o is readable through the data register address, but the i/o state comes directly from the cmos schmitt trigger output and not from the data register output. 4.1.2.2 output mode when ddr=1, the corresponding i/o is configured in output mode. in this case, the output buffer is activated according to the data registers content. a read operation is directly performed from the data register output. 4.1.2.3 analog input each i/o can be used as analog input by adding an analog switch driven by the adc. the i/o must be configured in input before using it as analog input. the cmos schmitt trigger is off and the analog value directly input through an analog switch to the analog to digital converter, when the analog channel is selected by the adc. 4.1.2.4 alternate mode a signal coming from a on-chip peripheral can be output on the i/o. in this case, the i/o is automatically configured in output mode. this must be controlled directly by the peripheral with a signal coming from the peripheral which enables the alternate signal to be output. a signal coming from an i/o can be input in a on- chip peripheral. before using an i/o as alternate input, it must be configured in input mode (ddr=0). so both alternate input configuration and i/o input configuration are the same (with or without pull- up). the signal to be input in the peripheral is taken after the cmos schmitt trigger or ttl schmitt trigger for sync. the i/o state is readable as in input mode by addressing the corresponding i/o data register. ddr mode 0 input 1 output
st72774/st727754/st72734 29/144 figure 16. input structure for sync signals 4.1.3 port a pa7 and pa[2:0] can be defined as input lines (with pull-up) or as push-pull outputs. pa [6:3] can be defined as input lines (without pull- up) or as output open drain lines. pa7 and pa[2:0] can be defined as input lines (with pull-up) or as push-pull outputs. pa [6:3] can be defined as input lines (without pull- up) or as output open drain lines. table 8. port a description pin hsynci input i/o logic (if existing) ttl trigger (no pull-up) pin csynci input i/o logic (if existing) ttl trigger pull-up v dd vsynci input hfback input vfback input port a i / o alternate function input* output signal condition pa0 with pull-up push-pull ocmp1 oc1e =1 (cr2[timer]) pa1 with pull-up push-pull - - pa2 with pull-up push-pull vsynci2 vsyncsel=1 (miscr) pa3 without pull-up open-drain - - pa4 without pull-up open-drain - - pa5 without pull-up open-drain - - pa6 without pull-up open-drain - - pa7 with pull-up push-pull blankout blken = 1 (enr[sync]) *reset state
st72774/st727754/st72734 30/144 i/o ports (contd) figure 17. pa0 to pa2, pa7 figure 18. pa3 to pa6 dr ddr latch latch data bus dr sel ddr sel v dd pad oc1e oc1e alternate enable alternate pull-up p-buffer n-buffer 1 0 1 0 cmos schmitt trigger v ss output data bus dr sel ddr sel pad alternate enable alternate enable alternate alternate input output n-buffer 1 0 1 0 cmos schmitt trigger v ss dr ddr latch latch
st72774/st727754/st72734 31/144 i/o ports (contd) 4.1.4 port b the alternate functions are the i/o pins of the on- chip ddc scld & scdad for pb0:1, the i/o pins of the on-chip i2c scli & scdai for pb2:3, and 4 bits of port b bit can be used as the analog source to the analog to digital converter. only one i/o line must be configured as an analog input at any time. the user must avoid any situation in which more than one i/o pin is selected as an analog input simultaneously to avoid device malfunction. when the analog function is selected for an i/o pin, the pull-up of the respective pin of port b is disconnected and the digital input is off. all unused i/o lines should be tied to an appropriate logic level (either v dd or v ss ) since the adc is on the same chip as the microprocessor, the user should not switch heavily loaded signals during conversion, if high precision is required. such switching will affect the supply voltages used as analog references. the accuracy of the conversion depends on the quality of the power supplies (v dd and v ss ). the user must take special care to ensure that a well regulated reference voltage is present on the v dd and v ss pins (power supply variations must be less than 5v/ms). this implies, in particular, that a suitable decoupling capacitor is used at the v dd pin. table 9. port b description port b i/o alternate function input* output signal condition pb0 without pull-up open-drain scld (input with cmos schmitt trigger or open drain output) ddc enable pb1 without pull-up open-drain sdad (input with cmos schmitt trigger or open drain output) ddc enable pb2 without pull-up open-drain scli (input with cmos schmitt trigger or open drain output) i2c enable pb3 without pull-up open-drain sdai (input with cmos schmitt trigger or open drain output) i2c enable pb4 with pull-up push-pull analog input (adc) (without pull-up) ch[2:0]=000 (adccsr) pb5 with pull-up push-pull analog input (adc) (without pull-up) ch[2:0]=001 (adccsr) pb6 with pull-up push-pull analog input (adc) (without pull-up) ch[2:0]=010 (adccsr) 10-bit output 1 (pwm) oe0=1 (pwmoe) pb7 with pull-up push-pull analog input (adc) (without pull-up) ch[2:0]=011 (adccsr) 10-bit output 2 (pwm) oe1=1 (pwmoe) *reset state
st72774/st727754/st72734 32/144 i/o ports (contd) figure 19. pb0 to pb3 figure 20. pb4 to pb7 data bus dr sel ddr sel pad alternate enable alternate enable alternate alternate input output n-buffer 1 0 1 0 cmos schmitt trigger v ss dr ddr latch latch data bus dr sel ddr sel v dd pad analog switch analog enable (adc) common analog rail pull-up p-buffer n-buffer 1 0 cmos schmitt trigger v ss dr ddr latch latch 1 0 dr sel
st72774/st727754/st72734 33/144 i/o ports (contd) 4.1.5 port c the available port pins of port c may be used as general purpose i/o. the alternate functions are the pwm outputs for pc2:7, hsyncdiv (hsynco divided by 2) for pc0 and the tmu input for pc1. table 10. port c description port c i / o alternate function input* output signal condition pc0 with pull-up push-pull hsyncdiv (push-pull) hsyncdiven =1 (miscr) pc1 with pull-up push-pull av (active video) input (tmu) - pc2 with pull-up push-pull 10-bit output 3 (pwm) oe2=1 (pwmoe) pc3 with pull-up push-pull 10-bit output 4 (pwm) oe3=1 (pwmoe) pc4 with pull-up push-pull 10-bit output 5 (pwm) oe4=1 (pwmoe) pc5 with pull-up push-pull 10-bit output 6 (pwm) oe5=1 (pwmoe) pc6 with pull-up push-pull 10-bit output 7 (pwm) oe6=1 (pwmoe) pc7 with pull-up push-pull 10-bit output 8 (pwm) oe7=1 (pwmoe) * reset state
st72774/st727754/st72734 34/144 i/o ports (contd) figure 21. pc0, pc2 to pc7 figure 22. pc1 dr ddr latch latch data bus dr sel ddr sel v dd pad oc1e oc1e alternate enable alternate pull-up p-buffer n-buffer 1 0 1 0 cmos schmitt trigger v ss output data bus dr sel ddr sel av pull-up p-buffer n-buffer 1 0 cmos schmitt trigger v ss v dd pad dr ddr latch latch
st72774/st727754/st72734 35/144 i/o ports (contd) 4.1.6 port d the port d i/o pins are normally used for the input and output of video synchronization signals of the sync processor, but are set to i/o input with pull- up upon reset. the i/o mode can be set individually for each port bit to input with pull-up and output push-pull through the port d ddr. the configuration to support the sync processor requires that the synop (bit7) and clmpen (bit6) of the enr (enable register of sync) is reset. synop enables port d bits 0,1 and clmpen enables port d bit 6 to the sync outputs. port d, bit 4:3 are the alternate inputs ita, itb, (for the interrupt falling edge detector). when a falling edge occurs on these inputs, an interrupt will be generated depending on the status of the intx (itaite & itbite) bits in the miscr register. port d, bit 6 is switched to the alternate (clampout) by resetting the clmpen bit of the enr register inside sync block. if the sync function is selected, port d bit 5 and 3 must be set as input to enable the hfback or vfback timing inputs. note: as these inputs are switched from normal i/o functionality, the video synchronization signals may also be monitored directly through the port d data register for such tasks as checking for the presence of video signals or checking the polarity of horizontal and vertical synchronization signals (when the sync inputs are switched directly to the outputs using the multiplexers of the sync proces- sor). table 11. port d description port d i / o alternate function input* output signal condition pd0 with pull-up push-pull vsynco (push pull output) synop=0 (enr [sync]) pd1 with pull-up push-pull hsynco (push pull output) synop=0 (enr [sync]) pd2 with pull-up push-pull csynci (input with ttl schmitt trigger & pull-up) - pd3 with pull-up push-pull ita (input with cmos schmitt trigger & pull-up) - vfback (input with ttl schmitt trigger & pull-up) - pd4 with pull-up push-pull itb (input with cmos schmitt trigger & pull-up) - pd5 with pull-up push-pull hfback (input with ttl schmitt trigger & pull-up) - pd6 with pull-up push-pull clampout (push pull output) clmpen=0 (enr [sync]) * reset state
st72774/st727754/st72734 36/144 i/o ports (contd) figure 23. pd2 to pd5 figure 24. pd0 to pd1 dr ddr latch latch data bus dr sel ddr sel v dd pad pull-up p-buffer n-buffer 1 0 cmos schmitt trigger vfback input ttl schmitt trigger v ss alternate input csynci input hfback input dr ddr latch latch data bus dr sel ddr sel v dd pad alternate enable alternate enable alternate enable alternate alternate input pull-up output p-buffer n-buffer 1 0 1 0 cmos schmitt trigger v ss
st72774/st727754/st72734 37/144 i/o ports (contd) figure 25. pd6 dr ddr latch latch data bus dr sel ddr sel v dd pad alternate enable alternate enable alternate enable alternate alternate input pull-up output p-buffer n-buffer 1 0 1 0 cmos schmitt trigger v ss vsynci2 input ttl schmitt trigger
st72774/st727754/st72734 38/144 i/o ports (contd) 4.1.7 register description data registers (pxdr) read/write reset value: 0000 0000 (00h) data direction registers (pxddr) read/write reset value: 0000 0000 (00h) (as inputs) table 12. i/o ports register map 70 msb lsb 70 msb lsb address (hex.) register name 765 4 3210 00 padr msb lsb 01 paddr msb lsb 02 pbdr msb lsb 03 pbddr msb lsb 04 pcdr msb lsb 05 pcddr msb lsb 06 pddr msb lsb 07 pdddr msb lsb
st72774/st727754/st72734 39/144 4.2 watchdog timer (wdg) 4.2.1 introduction the watchdog timer is used to detect the occurrence of a software fault, usually generated by external interference or by unforeseen logical conditions, which causes the application program to abandon its normal sequence. the watchdog circuit generates an mcu reset on expiry of a programmed time period, unless the program refreshes the counters contents before the t6 bit becomes cleared. 4.2.2 main features n programmable timer (64 increments of 49152 cpu cycles) n programmable reset n reset (if watchdog activated) when the t6 bit reaches zero figure 26. watchdog block diagram 4.2.3 functional description the counter value stored in the cr register (bits t6:t0), is decremented every 49,152 machine cycles, and the length of the timeout period can be programmed by the user in 64 increments. if the watchdog is activated (the wdga bit is set) and when the 7-bit timer (bits t6:t0) rolls over from 40h to 3fh (t6 becomes cleared), it initiates a reset cycle pulling low the reset pin for typically 500ns. the application program must write in the cr register at regular intervals during normal operation to prevent an mcu reset. the value to be stored in the cr register must be between ffh and c0h (see table 13 . watchdog timing (fcpu = 8 mhz) ): C the wdga bit is set (watchdog enabled) C the t6 bit is set to prevent generating an imme- diate reset C the t5:t0 bits contain the number of increments which represents the time delay before the watchdog produces a reset. reset wdga 7-bit downcounter f cpu t6 t0 clock divider watchdog control register (cr) ? 49152 t1 t2 t3 t4 t5
st72774/st727754/st72734 40/144 table 13. watchdog timing (f cpu = 8 mhz) notes: following a reset, the watchdog is disabled. once activated it cannot be disabled, except by a reset. the t6 bit can be used to generate a software reset (the wdga bit is set and the t6 bit is cleared). 4.2.4 interrupts none. 4.2.5 register description control register (cr) read/write reset value: 0111 1111 (7fh) bit 7 = wdga activation bit . this bit is set by software and only cleared by hardware after a reset. when wdga = 1, the watchdog can generate a reset. 0: watchdog disabled 1: watchdog enabled bit 6:0 = t[6:0] 7-bit timer (msb to lsb). these bits contain the decremented value. a reset is produced when it rolls over from 40h to 3fh (t6 becomes cleared). table 14. watchdog timer register map and reset values cr register initial value wdg timeout period (ms) max ffh 393.216 min c0h 6.144 70 wdga t6 t5 t4 t3 t2 t1 t0 address (hex.) register label 765 4 3210 08 wdgcr reset value wdga 0 t6 1 t5 1 t4 1 t3 1 t2 1 t1 1 t0 1
st72774/st727754/st72734 41/144 4.3 16-bit timer (tim) 4.3.1 introduction the timer consists of a 16-bit free-running counter driven by a programmable prescaler. it may be used for a variety of purposes, including pulse length measurement of up to two input signals ( input capture ) or generation of up to two output waveforms ( output compare and pwm ). pulse lengths and waveform periods can be modulated from a few microseconds to several milliseconds using the timer prescaler and the cpu clock prescaler. 4.3.2 main features n programmable prescaler: f cpu divided by 2, 4 or 8. n overflow status flag and maskable interrupt n external clock input (must be at least 4 times slower than the cpu clock speed) with the choice of active edge n output compare functions with C 2 dedicated 16-bit registers C 2 dedicated programmable signals C 2 dedicated status flags C 1 dedicated maskable interrupt n input capture functions with C 2 dedicated 16-bit registers C 2 dedicated active edge selection signals C 2 dedicated status flags C 1 dedicated maskable interrupt n pulse width modulation mode (pwm) n one pulse mode n 5 alternate functions on i/o ports* the block diagram is shown in figure 27 . note: some external pins are not available on all devices. refer to the device pin out description. 4.3.3 functional description 4.3.3.1 counter the principal block of the programmable timer is a 16-bit free running counter and its associated 16- bit registers: counter registers C counter high register (chr) is the most sig- nificant byte (msb). C counter low register (clr) is the least sig- nificant byte (lsb). alternate counter registers C alternate counter high register (achr) is the most significant byte (msb). C alternate counter low register (aclr) is the least significant byte (lsb). these two read-only 16-bit registers contain the same value but with the difference that reading the aclr register does not clear the tof bit (overflow flag), (see note page 43 ). writing in the clr register or aclr register resets the free running counter to the fffch value. the timer clock depends on the clock control bits of the cr2 register, as illustrated in table 15 clock control bits . the value in the counter register repeats every 131.072, 262.144 or 524.288 internal processor clock cycles depending on the cc1 and cc0 bits.
st72774/st727754/st72734 42/144 16-bit timer (contd) figure 27. timer block diagram mcu-peripheral interface counter alternate register output compare register output compare edge detect overflow detect circuit 1/2 1/4 1/8 8-bit buffer st7 internal bus latch1 ocmp1 icap1 extclk cpu clock timer interrupt icf2 icf1 0 0 0 ocf2 ocf1 tof pwm oc1e exedg iedg2 cc0 cc1 oc2e opm folv2 icie olvl1 iedg1 olvl2 folv1 ocie toie icap2 latch2 ocmp2 8 8 8 low 16 8 high 16 16 16 16 cr1 cr2 sr 6 16 8 8 8 8 8 8 high low high high high low low low exedg timer internal bus circuit1 edge detect circuit2 circuit 1 output compare register 2 input capture register 1 input capture register 2 cc1 cc0 16 bit free running counter
st72774/st727754/st72734 43/144 16-bit timer (contd) 16-bit read sequence: (from either the counter register or the alternate counter register). the user must read the msb first, then the lsb value is buffered automatically. this buffered value remains unchanged until the 16-bit read sequence is completed, even if the user reads the msb several times. after a complete reading sequence, if only the clr register or aclr register are read, they return the lsb of the count value at the time of the read. an overflow occurs when the counter rolls over from ffffh to 0000h then: C the tof bit of the sr register is set. C a timer interrupt is generated if: C toie bit of the cr1register is set and C i bit of the cc register is cleared. if one of these conditions is false, the interrupt remains pending to be issued as soon as they are both true. clearing the overflow interrupt request is done by: 1. reading the sr register while the tof bit is set. 2. an access (read or write) to the clr register. notes: the tof bit is not cleared by accesses to aclr register. this feature allows simultaneous use of the overflow function and reads of the free running counter at random times (for example, to measure elapsed time) without the risk of clearing the tof bit erroneously. the timer is not affected by wait mode. 4.3.3.2 external clock the external clock (where available) is selected if cc0=1 and cc1=1 in cr2 register. the status of the exedg bit determines the type of level transition on the external clock pin extclk that will trigger the free running counter. the counter is synchronised with the falling edge of the internal cpu clock. at least four falling edges of the cpu clock must occur between two consecutive active edges of the external clock; thus the external clock frequency must be less than a quarter of the cpu clock frequency. lsb is buffered read msb at t0 read lsb returns the buffered lsb value at t0 at t0 + d t other instructions beginning of the sequence sequence completed
st72774/st727754/st72734 44/144 16-bit timer (contd) figure 28. counter timing diagram, internal clock divided by 2 figure 29. counter timing diagram, internal clock divided by 4 figure 30. counter timing diagram, internal clock divided by 8 cpu clock fffd fffe ffff 0000 0001 0002 0003 internal reset timer clock counter register overflow flag tof fffc fffd 0000 0001 cpu clock internal reset timer clock counter register overflow flag tof cpu clock internal reset timer clock counter register overflow flag tof fffc fffd 0000
st72774/st727754/st72734 45/144 16-bit timer (contd) 4.3.3.3 input capture in this section, the index, i , may be 1 or 2. the two input capture 16-bit registers (ic1r and ic2r) are used to latch the value of the free running counter after a transition detected by the icap i pin (see figure 5). ic i rregister is a read-only register. the active transition is software programmable through the iedg i bit of the control register (cr i ). timing resolution is one count of the free running counter: ( f cpu/(cc1.cc0) ). procedure to use the input capture function select the following in the cr2 register: C select the timer clock (cc1-cc0) (see table 15 clock control bits ). C select the edge of the active transition on the icap2 pin with the iedg2 bit. and select the following in the cr1 register: C set the icie bit to generate an interrupt after an input capture. C select the edge of the active transition on the icap1 pin with the iedg1 bit. when an input capture occurs: C icf i bit is set. C the ic i r register contains the value of the free running counter on the active transition on the icap i pin (see figure 32 ). C a timer interrupt is generated if the icie bit is set and the i bit is cleared in the cc register. other- wise, the interrupt remains pending until both conditions become true. clearing the input capture interrupt request is done by: 1. reading the sr register while the icf i bit is set. 2. an access (read or write) to the ic i lr register. after reading the ic i hr register, transfer of input capture data is inhibited until the ic i lr register is also read. the ic i r register always contains the free running counter value which corresponds to the most recent input capture. ms byte ls byte ic i ric i hr ic i lr
st72774/st727754/st72734 46/144 16-bit timer (contd) figure 31. input capture block diagram figure 32. input capture timing diagram icie cc0 cc1 16-bit free running counter iedg1 (control register 1) cr1 (control register 2) cr2 icf2 icf1 0 0 0 (status register) sr iedg2 icap1 icap2 edge detect circuit2 16-bit ic1r ic2r edge detect circuit1 ff01 ff02 ff03 ff03 timer clock counter register icapi pin icapi flag icapi register note: a ctive edge is rising edge.
st72774/st727754/st72734 47/144 16-bit timer (contd) 4.3.3.4 output compare in this section, the index, i , may be 1 or 2. this function can be used to control an output waveform or indicating when a period of time has elapsed. when a match is found between the output compare register and the free running counter, the output compare function: C assigns pins with a programmable value if the ocie bit is set C sets a flag in the status register C generates an interrupt if enabled two 16-bit registers output compare register 1 (oc1r) and output compare register 2 (oc2r) contain the value to be compared to the free running counter each timer clock cycle. these registers are readable and writable and are not affected by the timer hardware. a reset event changes the oc i r value to 8000h. timing resolution is one count of the free running counter: ( f cpu/(cc1.cc0) ). procedure to use the output compare function, select the following in the cr2 register: C set the oc i e bit if an output is needed then the ocmp i pin is dedicated to the output compare i function. C select the timer clock (cc1-cc0) (see table 15 clock control bits ). and select the following in the cr1 register: C select the olvl i bit to applied to the ocmp i pins after the match occurs. C set the ocie bit to generate an interrupt if it is needed. when match is found: C ocf i bit is set. C the ocmp i pin takes olvl i bit value (ocmp i pin latch is forced low during reset and stays low until valid compares change it to a high level). C a timer interrupt is generated if the ocie bit is set in the cr2 register and the i bit is cleared in the cc register (cc). clearing the output compare interrupt request is done by: 3. reading the sr register while the ocf i bit is set. 4. an access (read or write) to the oc i lr register. note: after a processor write cycle to the oc i hr register, the output compare function is inhibited until the oc i lr register is also written. if the oc i e bit is not set, the ocmp i pin is a general i/o port and the olvl i bit will not appear when match is found but an interrupt could be generated if the ocie bit is set. the value in the 16-bit oc i r register and the olv i bit should be changed after each successful comparison in order to control an output waveform or establish a new elapsed timeout. the oc i r register value required for a specific timing application can be calculated using the following formula: where: d t = desired output compare period (in seconds) f cpu = internal clock frequency cc1-cc0 = timer clock prescaler the following procedure is recommended to prevent the ocf i bit from being set between the time it is read and the write to the oc i r register: C write to the oc i hr register (further compares are inhibited). C read the sr register (first step of the clearance of the ocf i bit, which may be already set). C write to the oc i lr register (enables the output compare function and clears the ocf i bit). ms byte ls byte oc i roc i hr oc i lr d oc i r = d t * f cpu (cc1.cc0)
st72774/st727754/st72734 48/144 16-bit timer (contd) figure 33. output compare block diagram figure 34. output compare timing diagram, internal clock divided by 2 output compare 16-bit circuit oc1r 16 bit free running counter oc1e cc0 cc1 oc2e olvl1 olvl2 ocie (control register 1) cr1 (control register 2) cr2 0 0 0 ocf2 ocf1 (status register) sr 16-bit 16-bit ocmp1 ocmp2 latch 1 latch 2 oc2r internal cpu clock timer clock counter output compare register compare register latch ocfi and ocmpi pin (olvli=1) cpu writes ffff ffff fffd fffd fffe ffff 0000 fffc
st72774/st727754/st72734 49/144 16-bit timer (contd) 4.3.3.5 forced compare mode in this section i may represent 1 or 2. the following bits of the cr1 register are used: when the folv i bit is set, the olvl i bit is copied to the ocmp i pin. the folv i bit is not cleared by software, only by a chip reset. the olv i bit has to be toggled in order to toggle the ocmp i pin when it is enabled (oc i e bit=1). the ocf i bit is not set, and thus no interrupt request is generated. 4.3.3.6 one pulse mode one pulse mode enables the generation of a pulse when an external event occurs. this mode is selected via the opm bit in the cr2 register. the one pulse mode uses the input capture1 function and the output compare1 function. procedure to use one pulse mode, select the following in the the cr1 register: C using the olvl1 bit, select the level to be ap- plied to the ocmp1 pin after the pulse. C using the olvl2 bit, select the level to be ap- plied to the ocmp1 pin during the pulse. C select the edge of the active transition on the icap1 pin with the iedg1 bit . and select the following in the cr2 register: C set the oc1e bit, the ocmp1 pin is then dedi- cated to the output compare 1 function. C set the opm bit. C select the timer clock cc1-cc0 (see table 15 clock control bits ). load the oc1r register with the value corresponding to the length of the pulse (see the formula in section 4.3.3.7 ). then, on a valid event on the icap1 pin, the counter is initialized to fffch and olvl2 bit is loaded on the ocmp1 pin. when the value of the counter is equal to the value of the contents of the oc1r register, the olvl1 bit is output on the ocmp1 pin, (see figure 35 ). note: the ocf1 bit cannot be set by hardware in one pulse mode but the ocf2 bit can generate an out- put compare interrupt. the icf1 bit is set when an active edge occurs and can generate an interrupt if the icie bit is set. when the pulse width modulation (pwm) and one pulse mode (opm) bits are both set, the pwm mode is the only active one. figure 35. one pulse mode timing folv2 folv1 olvl2 olvl1 event occurs counter is initialized to fffch ocmp1 = olvl2 counter = oc1r ocmp1 = olvl1 when when on icap1 one pulse mode cycle counter .... fffc fffd fffe 2ed0 2ed1 2ed2 2ed3 fffc fffd olvl2 olvl2 olvl1 icap1 ocmp1 compare1 note: iedg1=1, oc1r=2ed0h, olvl1=0, olvl2=1
st72774/st727754/st72734 50/144 16-bit timer (contd) 4.3.3.7 pulse width modulation mode pulse width modulation mode enables the generation of a signal with a frequency and pulse length determined by the value of the oc1r and oc2r registers. the pulse width modulation mode uses the complete output compare 1 function plus the oc2r register. procedure to use pulse width modulation mode select the following in the cr1 register: C using the olvl1 bit, select the level to be ap- plied to the ocmp1 pin after a successful com- parison with oc1r register. C using the olvl2 bit, select the level to be ap- plied to the ocmp1 pin after a successful com- parison with oc2r register. and select the following in the cr2 register: C set oc1e bit: the ocmp1 pin is then dedicated to the output compare 1 function. C set the pwm bit. C select the timer clock (cc1-cc0) (see table 15 clock control bits ). load the oc2r register with the value corresponding to the period of the signal. load the oc1r register with the value corresponding to the length of the pulse if (olvl1=0 and olvl2=1). if olvl1=1 and olvl2=0 the length of the pulse is the difference between the oc2r and oc1r registers. the oc i r register value required for a specific timing application can be calculated using the following formula: where: C t = desired output compare period (seconds) Cf cpu = internal clock frequency (see miscella- neous register) C cc1-cc0 = timer clock prescaler the output compare 2 event causes the counter to be initialized to fffch (see figure 36 ). note: after a write instruction to the oc i hr register, the output compare function is inhibited until the oc i lr register is also written. the ocf1 and ocf2 bits cannot be set by hardware in pwm mode therefore the output compare interrupt is inhibited. the input capture interrupts are available. when the pulse width modulation (pwm) and one pulse mode (opm) bits are both set, the pwm mode is the only active one. figure 36. pulse width modulation mode timing oc i r value = t * f cpu (cc1.cc0) - 5 counter counter is reset to fffch ocmp1 = olvl2 counter = oc2r ocmp1 = olvl1 when when = oc1r pulse width modulation cycle counter 34e2 fffc fffd fffe 2ed0 2ed1 2ed2 34e2 fffc olvl2 olvl2 olvl1 ocmp1 compare2 compare1 compare2 note: oc1r=2ed0h, oc2r=34e2, olvl1=0, olvl2= 1
st72774/st727754/st72734 51/144 4.3.4 register description each timer is associated with three control and status registers, and with six pairs of data registers (16-bit values) relating to the two input captures, the two output compares, the counter and the alternate counter. control register 1 (cr1) read/write reset value: 0000 0000 (00h) bit 7 = icie input capture interrupt enable. 0: interrupt is inhibited. 1: a timer interrupt is generated whenever the icf1 or icf2 bit of the sr register is set. bit 6 = ocie output compare interrupt enable. 0: interrupt is inhibited. 1: a timer interrupt is generated whenever the ocf1 or ocf2 bit of the sr register is set. bit 5 = toie timer overflow interrupt enable. 0: interrupt is inhibited. 1: a timer interrupt is enabled whenever the tof bit of the sr register is set. bit 4 = folv2 forced output compare 2. this bit is not cleared by software, only by a chip reset. 0: no effect. 1:forces the olvl2 bit to be copied to the ocmp2 pin. bit 3 = folv1 forced output compare 1. this bit is not cleared by software, only by a chip reset. 0: no effect. 1: forces olvl1 to be copied to the ocmp1 pin. bit 2 = olvl2 output level 2. this bit is copied to the ocmp2 pin whenever a successful comparison occurs with the oc2r register and ocxe is set in the cr2 register. this value is copied to the ocmp1 pin in one pulse mode and pulse width modulation mode. bit 1 = iedg1 input edge 1. this bit determines which type of level transition on the icap1 pin will trigger the capture. 0: a falling edge triggers the capture. 1: a rising edge triggers the capture. bit 0 = olvl1 output level 1. the olvl1 bit is copied to the ocmp1 pin whenever a successful comparison occurs with the oc1r register and the oc1e bit is set in the cr2 register. 70 icie ocie toie folv2 folv1 olvl2 iedg1 olvl1
st72774/st727754/st72734 52/144 16-bit timer (contd) control register 2 (cr2) read/write reset value: 0000 0000 (00h) bit 7 = oc1e output compare 1 enable. 0: output compare 1 function is enabled, but the ocmp1 pin is a general i/o. 1: output compare 1 function is enabled, the ocmp1 pin is dedicated to the output com- pare 1 capability of the timer. bit 6 = oc2e output compare 2 enable. 0: output compare 2 function is enabled, but the ocmp2 pin is a general i/o. 1: output compare 2 function is enabled, the ocmp2 pin is dedicated to the output com- pare 2 capability of the timer. bit 5 = opm one pulse mode. 0: one pulse mode is not active. 1: one pulse mode is active, the icap1 pin can be used to trigger one pulse on the ocmp1 pin; the active transition is given by the iedg1 bit. the length of the generated pulse depends on the contents of the oc1r regis- ter. bit 4 = pwm pulse width modulation. 0: pwm mode is not active. 1: pwm mode is active, the ocmp1 pin outputs a programmable cyclic signal; the length of the pulse depends on the value of oc1r reg- ister; the period depends on the value of oc2r register. bit 3, 2 = cc1-cc0 clock control. the value of the timer clock depends on these bits: table 15. clock control bits bit 1 = iedg2 input edge 2. this bit determines which type of level transition on the icap2 pin will trigger the capture. 0: a falling edge triggers the capture. 1: a rising edge triggers the capture. bit 0 = exedg external clock edge. this bit determines which type of level transition on the external clock pin extclk will trigger the free running counter. 0: a falling edge triggers the free running coun- ter. 1: a rising edge triggers the free running coun- ter. 70 oc1e oc2e opm pwm cc1 cc0 iedg2 exedg cc1 cc0 timer clock 00 f cpu / 4 01 f cpu / 2 10 f cpu / 8 11 external clock (where available)
st72774/st727754/st72734 53/144 16-bit timer (contd) status register (sr) read only reset value: 0000 0000 (00h) the three least significant bits are not used. bit 7 = icf1 input capture flag 1. 0: no input capture (reset value). 1: an input capture has occurred. to clear this bit, first read the sr register, then read or write the low byte of the ic1r (ic1lr) regis- ter. bit 6 = ocf1 output compare flag 1. 0: no match (reset value). 1: the content of the free running counter has matched the content of the oc1r register. to clear this bit, first read the sr register, then read or write the low byte of the oc1r (oc1lr) register. bit 5 = tof timer overflow. 0: no timer overflow (reset value). 1:the free running counter rolled over from ffffh to 0000h. to clear this bit, first read the sr register, then read or write the low byte of the cr (clr) register. note: reading or writing the aclr register does not clear tof. bit 4 = icf2 input capture flag 2. 0: no input capture (reset value). 1: an input capture has occurred.to clear this bit, first read the sr register, then read or write the low byte of the ic2r (ic2lr) regis- ter. bit 3 = ocf2 output compare flag 2. 0: no match (reset value). 1: the content of the free running counter has matched the content of the oc2r register. to clear this bit, first read the sr register, then read or write the low byte of the oc2r (oc2lr) register. bit 2-0 = unused. input capture 1 high register (ic1hr) read only reset value: undefined this is an 8-bit read only register that contains the high part of the counter value (transferred by the input capture 1 event). input capture 1 low register (ic1lr) read only reset value: undefined this is an 8-bit read only register that contains the low part of the counter value (transferred by the input capture 1 event). output compare 1 high register (oc1hr) read/write reset value: 1000 0000 (80h) this is an 8-bit register that contains the high part of the value to be compared to the chr register. output compare 1 low register (oc1lr) read/write reset value: 0000 0000 (00h) this is an 8-bit register that contains the low part of 70 icf1 ocf1 tof icf2 ocf2 70 msb lsb 70 msb lsb 70 msb lsb
st72774/st727754/st72734 54/144 16-bit timer (contd) output compare 2 high register (oc2hr) read/write reset value: 1000 0000 (80h) this is an 8-bit register that contains the high part of the value to be compared to the chr register. output compare 2 low register (oc2lr) read/write reset value: 0000 0000 (00h) this is an 8-bit register that contains the low part of the value to be compared to the clr register. counter high register (chr) read only reset value: 1111 1111 (ffh) this is an 8-bit register that contains the high part of the counter value. counter low register (clr) read/write reset value: 1111 1100 (fch) this is an 8-bit register that contains the low part of the counter value. a write to this register resets the counter. an access to this register after accessing the sr register clears the tof bit. alternate counter high register (achr) read only reset value: 1111 1111 (ffh) this is an 8-bit register that contains the high part of the counter value. alternate counter low register (aclr) read/write reset value: 1111 1100 (fch) this is an 8-bit register that contains the low part of the counter value. a write to this register resets the counter. an access to this register after an access to sr register does not clear the tof bit in sr register. input capture 2 high register (ic2hr) read only reset value: undefined this is an 8-bit read only register that contains the high part of the counter value (transferred by the input capture 2 event). input capture 2 low register (ic2lr) read only reset value: undefined 70 msb lsb 70 msb lsb 70 msb lsb 70 msb lsb 70 msb lsb 70 msb lsb 70 msb lsb
st72774/st727754/st72734 55/144 16-bit timer (contd) table 16. 16-bit timer register map address (hex.) register name 76543210 11 cr2 oc1e oc2e opm pwm cc1 cc0 iedg2 exedg 12 cr1 icie ocie toie folv2 folv1 olvl2 iedg1 olvl1 13 sr icf1 ocf1 tof icf2 ocf2 0 0 0 14 ic1hr msb lsb 15 ic1lr msb lsb 16 oc1hr msb lsb 17 oc1lr msb lsb 18 chr msb lsb 19 clr msb lsb 1a achr msb lsb 1b aclr msb lsb 1c ic2hr msb lsb 1d ic2lr msb lsb 1e oc2hr msb lsb 1f oc2lr msb lsb
st72774/st727754/st72734 56/144 4.4 sync processor (sync) 4.4.1 introduction the sync processor handles all the management tasks of the video synchronization signals, and is used with the timer and software to provide information and status on the video standard and timings. this block supports multiple video standards such as: separate sync, composite sync and (via an external extractor) sync on green. the internal clock in the sync processor is 4 mhz. 4.4.2 main features n input processing C presence of incoming signals (edge detection) C read the hsynci / vsynci input signal levels C measure the signal periods C detect the sync polarities C detect the composite sync and extract vsynco n output processing C control the sync output polarities C generate free-running frequencies C generate a video blanking signal C generate a clamping signal or a moire signal n analyzer mode C measure the number of scan lines per frame to simplify osd vertical centering C detect hsynci reaching too high a frequency C detect pre/post equalization pulses C measure the low level of hsynco or hfback n corrector mode C inhibit pre/post equalization pulses C program vsynco pulse width extension C extend vsynco pulse widths during: post-equalization pulse detection only pre and post-equalization pulse detection note: some external pins are not available on all devices. refer to the device pinout description. figure 37. sync processor block diagram sync generator sync analyzer sync corrector hardware block vsync generator 40 - 200 hz typical pulse width 20 - 256 s hsync generator 15 - 200 khz duty cycle range 3 - 40 % latch 00 match latch 1f match lcv0 sync & edge detect capture register ld v sync o polarity v sync correction polarity detector pull-up resistor (if existing) vsynci1 vsynco 1 0 hsynci2 clampout hsynco icap1 timer hvgen csynci clpinv 1 0 lcv1 vsync* lcv1 sci0 icap2 timer vsynci hsynci / csynci pscd hvgen 1 0 synop synop h sync o polarity h sync o correction h-inhibit on/off back porch clamp generator clamp polarity latch pulse detect prescaler v s y n c o 5-bit counter en up / down clk f int control logic vr02071c clmpen 0 1 vfback 1 0 fbsel fbsel 00 other bp1, bp0 hfback vfback latch pulse detect latch pulse detect vsynci2 1 0 hvsel 1 0 hvsel hsynci1 (positive polarity) hfback blanking generator blankout blken (see note) note: clk is f int/2 in fast mode (see note in clock system section)
st72774/st727754/st72734 57/144 sync processor (sync) (contd) 4.4.3 input signals the sync processor has the following inputs (ttl level): C vsynci1 vertical sync input1 C hsynci1 horizontal sync input1 or composite sync C vsynci2 vertical sync input2 C hsynci2 horizontal sync input2 or composite sync note: the above input pairs can be used for dsub or bnc connectors. to select these inputs use the hvsel bit in the polr register. C csynci sync on green (external extractor) note: if the csynci pin is needed for another i/o func- tion, the composite sync signal can be connected to hsynci using the sci0 bit in the mcr register. C hfback horizontal flyback input C vfback vertical flyback input 4.4.4 input signal waveforms C the input signals must contain only synchroniza- tion pulses. in case of serration pulses on csyn- ci/hsynci, the pulse width should be less than 8s. C the vsynci signal is internally connected to timer input capture 1 (icap1). C the hsynci or csynci signal, prescaled by 256, is internally connected to timer input cap- ture 2 (icap2). C typical timing range: see figure 38 and 39 C if the timer clock is 2 mhz (external oscillator fre- quency 24 mhz): pv accuracy = +/- 1 timer clock (500ns) ph*256 accuracy = +/- 1 timer clock (500ns) (pv= vertical pulse, ph = horizontal pulse) 4.4.5 output signals the sync processor has the following outputs: hsynco horizontal sync output enable: synop bit in enr register programmable polarity: hs0/hs1 bits in mcr register in case of composite sync signal, the signal can be blanked by software during the vertical period (hinh bit in enr register). in case of separate sync, no blanking is generated. vsynco vertical sync output enable: synop bit in enr register programmable polarity: vop bit in the mcr register in case of composite sync the delay of the extracted vsync signal is: minimum: 500ns + hsynco pulse width maximum: 8750ns (max. threshold in ex- traction mode)
st72774/st727754/st72734 58/144 sync processor (sync) (contd) figure 38. typical horizontal sync input timing figure 39. vertical sync input timing vr01961 or: 5s < typical hor. total time < 66.66s (200khz) (15khz) maximum sync. pulse width: 7s note : minimum hperiod: 500ns + s/w interrupt servicing time (1 timer clock) vr01961a or: 5ms < typical ver. total time < 25ms (200hz) (40hz) typical sync. pulse width: 0.0384ms - 0.600ms note : minimum vperiod: 500ns + s/w interrupt servicing time (1 timer clock)
st72774/st727754/st72734 59/144 sync processor (sync) (contd) clampout and moire signal clamp output signal the clamping pulse generator can control the pulse width and polarity signal and can be configured as pseudo-front porch or back porch. to use the clampout signal: C select the clamping pulse width: bp0/bp1 bits in mcr register C program the clamp polarity: clpinv bit in polr register C select the clampout signal as back-porch (after falling edge of hsynco) or pseudo-front porch (after the rising edge of hsynco): hs0/hs1 bits in mcr register. C enable the clampout signal: clmpen bit in enr register moire signal the moire output signal is available (instead of the clamping signal) to reduce the screen moire effect and improve color transitions. the clampout pin is alternatively used to output a moire signal. the output signal toggles at each hfback rising edge. after each vfback falling edge, the value of the moire output is the opposite of the previous one, independent of the number of hfback pulses during the vfback low level. to use the moire signal: C select the moire signal: reset the bp0/bp1 bits in mcr register C enable the output signal: clmpen bit in enr register figure 40. clamping pulse (clampout) delay hsynco clampout maximum delay: programmable clamping width: 0, 167ns, 333ns, 666ns - (fixed delay of 10 to 30ns) + (f osc /2) = approx. 110ns.
st72774/st727754/st72734 60/144 figure 41. moire output (instead of clamping output) 4.4.5.1 blanking output signal the video blanking function uses vsynco, hfback, vfback as input signals and blankout output as video blanking output. this output pin is a 5v open-drain output and can be and-wired with any external video blanking signal. note: hfback, vfback, vsynco signals must have positive polarity. to use the video blanking signal: C program the polarity: blkinv bit in polr register C enable the blankout output: blken bit in enr register figure 42. video blanking stage simplified schematic hfback moire vfback blankout blken hfback vfback vsynco to edge detector (latr) r s to edge detector (latr) blkinv
st72774/st727754/st72734 61/144 sync processor (sync) (contd) 4.4.6 input processing 4.4.6.1 detecting signal presence the sync processor provides two ways of checking input signal presence, by directly polling the latr latch register or using the timer interrupts. polling check use the latch register (latr), to detect the presence of hsynci, vsynci, csynci, hfback and vfback signals. these latched bits are set when the falling edge of the corresponding signal is detected. they are cleared by software. interrupts check due to the fact that vsynci is connected to timer input capture 1 and hsynci or csynci is connected to timer input capture 2, the timer interrupts can be used to detect the presence of input signals. refer to the 16-bit timer chapter for the description of the timer registers. to use the interrupt method: C select input capture1 edge detection: iedg1 bit in the timer cr1 register C select input capture 2 edge detection (must be falling edge): iedg2 bit = 0 in the timer cr2 register C enable timer input capture interrupts: icie bit in the timer cr1 register. C select the hsync and vsync input signals: hvsel bit in the polr register C enable the prescaler for hsynci or csynci signal: pscd bit in the ccr register. C select the normal mode: lcv1/lcv0 bits in the ccr register. perform any of the following: C check for vsynci presence by monitoring inter- rupt requests from timer icap1. when vsynci is detected then either detect the vsynci polar- ity or check for hsynci presence. C check for hsynci presence by monitoring inter- rupt requests from timer icap2. on detecting hsynci, either detect its polarity or check if the- composite sync on hsynci pin is detected or check for csynci presence. C check for csynci presence by monitoring inter- rupt requests from timer icap2. 4.4.6.2 measuring sync period to measure the sync period, the sync processor block uses the timer input capture interrupts: C icap1 connected to vsynci signal C icap2 connected to hsynci/csynci signal with a 256 prescaler calculating the difference between two subsequent input captures (16-bit value) gives the period for 256xph (horizontal period) and pv (vertical period). the period accuracy is one timer clock (500ns at 2 mhz), so that the tolerance is 500ns for ph and 256 * ph (ph accuracy =1.95ns). notes: 1) in case of composite sync, the hsynci period measurement can be synchronized on the vsynci pulse by setting and resetting the prescaler pscd bit in the ccr register (for this function, the icap2 detection must be selected as falling edge). this avoids errors in the period measurement due to the vsync pulse. 2) the timer interrupt request should be masked during a write access to any of the sync processor control registers. important note: since the recognition of the video mode relies on the accuracy of the measurements, it is highly recommended to implement a counter- style algorithm which performs several consecutive measurements before switching between modes. the purpose of this algorithm is to filter out any glitches occurring on the video signals.
st72774/st727754/st72734 62/144 sync processor (sync) (contd) 4.4.6.3 detecting signal polarity the sync processor provides two ways for checking input signal polarity by polling the latches or using the 5-bit up/down counter. polling check C hsynci polarity detection: uplat/dwnlat bits in latr register these bits are directly connected to the 5-bit up/down counter. uplat=1/ downlat=0 hsynci polarity<0 uplat=0/ downlat=1 hsynci polarity>0 C vsynci polarity detection C vpol bit (vsynco polarity) in polr and C vop bit (vsynco polarity control) in mcr the delay between vsynci polarity changes and the vpol bit typically toggles within 4 msecs. the polarity detector includes an integrator to filter possible incoming vsynci glitches. 5-bit up/down counter check for hsynci polarity this method involves the internal 5-bit up/down counter. the counter value (cv4-cv0 bits) is updated with the 5-bit counter value at every detected edge on the signal monitored. it is incremented when the signal is high, otherwise it is decremented. C start the detection phase: initialize the 5-bit counter: write '00000' in the ccr register (cv4-cv0 bits). select normal mode on falling edge: lcv1/lcv0 = 0 in the ccr register. C software checks the counter value (cv4-cv0) after an interrupt (with the signal internally con- nected or icap2) or by polling (timeout 150s). positive polarity: the counter value < 1fh. negative polarity: the counter value =1fh on the falling edge. in case of a composite incoming signal, the software just has to check that the vsynco period and polarity are stable. 4.4.6.4 extracting vsynco from csynci in case of composite sync, the vertical sync output signal is extracted with the 5-bit up/down counter. initially, the width of an horizontal sync component pulse is automatically determined by hardware which defines a threshold for the 5-bit counter with a possible user-defined tolerance. the circuit then monitors for any incoming period greater than this previously captured value. this is then processed as the vsynco signal. to use the vsync extractor, the following steps are necessary: C detection of a composite sync signal: when the uplat and downlat bits in latr register are set, a composite sync signal or a hsynci polarity change is detected. if these bits are stable during two subsequent icap2 interrupt, the composite sync signal is stable. C defining a threshold: select the normal mode (lcv1/lcv0=0 in the ccr register). initialize the counter capture cv4-cv0 to 0. this automatically measures the hsynci pulse width. it defines a threshold in the cv4-cv0 bits used by the 5-bit up/down counter. it also allows to check the hsynci polarity (refer to the 5-bit up/down counter check paragraph. if a user-defined tolerance is to be added, then an updated value should be written in the ccr register (cv4-cv0 bits). in a composite sync signal, hsync and vsync always have the same polarity. C starting the vsynco hardware extraction mode: according to the composite sync polarity, select the extraction mode (lcv1/lcv0 in ccr register) and rewrite the counter if necessary. negative polarity: minimum threshold (00h) positive polarity: maximum threshold (1fh) note: the extracted vsynco signal always has negative polarity.
st72774/st727754/st72734 63/144 sync processor (sync) (contd) 4.4.6.5 example of vsynco extraction for a negative composite sync with serration pulses refer to figure 43 . in extraction mode, the 5-bit comparator checks the counter value with respect to the threshold. when the incoming signal is high, the counter is increased, otherwise it is decreased. when the counter reaches the threshold on its way down, vsynco is asserted. during the vertical blanking, the counter value is decreased down to a programmable minimum, i.e. it does not underflow. when the vertical period is finished, the counter starts counting up and when the maximum is reached, vsynco is negated. the extracted signal may be validated by software since it is input to timer icap1. serration pulses during vertical blanking can be filtered if the serration pulse widths are less than 8s. in the same way, positive composite sync signals can be used by properly selecting the edge sensitivity in hsynci width measurement mode (lcv0 bit). figure 43. vsynco extraction from a composite signal (negative polarity) figure 44. obtaining the 11-bit vertical period (v11bits) vr01990 8s composite signal input max pulse width: 8s 1f-threshold counter value: 1f=max serration pulses vsynco pulse max delay: 8s or threshold hsynco threshold 0=min vsynco generated 7 7 0 0 0 10 vgenr cfgr v11bits example: vgenr=cch, cfgr = 3h v11bits=663h q2 q1 q0
st72774/st727754/st72734 64/144 sync processor (sync) (contd) 4.4.7 output processing 4.4.7.1 generating free-running frequencies the free-running frequencies function is used to: C drive the monitor when no or bad sync signals are received. C stabilize the osd screen when the monitor is unlocked. C perform fast alignment for maintenance purpos- es. note: when free-running mode is active, the analyzer and corrector modes must be disabled. C vcordis = 1, vext = 0 in cfgr and polr registers for vertical output measurement C 2fhinh = 0 in cfgr register for horizontal low level measurment C vacq, hacq = 0, in cfgr register for ana- lyzer mode the sync processor can generate any of the following output sync signals hsynco, vsynco, clampout, blankout. to select the generation mode: C program the horizontal period using the hgenr register. C program the vertical period using the vgenr (8 bits) and cfgr (3 bits) registers (2047 scan lines per frame). refer to figure 44 . C configure the following bits: synop = 0 hvgen = 1 hacq = 0 vacq = 0 horizontal period ph = horizontal period = ((hgenr+1)/4) s pulse width: 2 s => hgenr min=8 polarity: positive hgenr range: [8..255] vertical period pv = vertical period = (ph * v11bits) s v11bits is a concatenation of vgenr and the q'2 q'1 q'0 bits of the cfgr register. refer to figure 44 . pulse width: 4 * ph => min value= 8s polarity: positive vgenr/cfgr range: [5..7ff] table 17. typical values for generated hsync signals table 18. typical values for generated vsync signals hgenr (hex value) h period hfreq pulse width duty cycle 13 5 s 200 khz 2 s 40% 1f 8 s 125 khz 2 s 25% 3f 16 s 62.5 khz 2 s 12.5% 7f 32 s 31.25 khz 2 s 6.2% ff 64 s 15.6 khz 2 s 3.1% hgenr (hex value) h period h freq v11bits (hex value) v period v freq pulse width 13 5 s 200 khz 7ff (2047) 10.2 ms 97.7 hz 20 s 13 5 s 200 khz 400 (1024) 5.1 ms 195 hz 20 s 1f 8 s 125 khz 7ff (2047) 16.3 ms 61 hz 32 s 1f 8 s 125 khz 400 (1024) 8.2 ms 122 hz 32 s 3f 16 s 62.5 khz 7ff (2047) 32.6 ms 30.6 hz 64 s 3f 16 s 62.5 khz 400 (1024) 16.4 ms 60.9 hz 64 s 7f 32 s 31.25 khz 7ff (2047) 65.5 ms 15 hz 128 s 7f 32 s 31.25 khz 400 (1024) 32.8 ms 30 hz 128 s
st72774/st727754/st72734 65/144 sync processor (sync) (contd) 4.4.8 analyzer mode the analyzer block is used for all extra measurements on the sync signals to manage the monitor functions: C measure the number of scan lines per frame (vsynco or vfback) to simplify the osd ver- tical centering. C measure the low level of hsynco or hfback. this function can be used for vsynco pulse extension or for a fast estimation of the incoming hsync signal period. C detection of the pre/post equalization pulses. notes: 1. analyzer mode should be performed before corrector mode. 2. when analyzer mode is active, the free-running frequencies generator and corrector mode must be disabled. C hvgen = 0 in enr register C 2fhinh 0 in cfgr register for horizontal low level measurement C vext = 0, vcordis = 1 in cfgr, polr reg- isters for vertical output measurement 3. if h/vback are selected (fbsel=0) corrector mode must be disabled 4. for all measurements, hsynco and vsynco must be positive . 4.4.8.1 horizontal low level measurement the measurement starts in setting hacq by software. when this bit is cleared by hardware, the hgenr register returns the result. the algorithm is shown in figure 45 . hlow = ((255-hgenr+1)/4) s note: hlow maximum value = 64s (even if real value is greater) for maximum accuracy, it is possible to measure the low level of hfback with the same technique (fbsel bit in the mcr register). figure 45. horizontal low level measurement vr02118a end hgenr=result hacq=0? measure hlow disable h correction mode 2fhinh=0 disable h internal generation hvgen=0 hsynco positive polarity necessary if signals are h/vsynco select h/vback or h/vsynco fbsel=0 or 1 hacq=1 start measurement no yes
st72774/st727754/st72734 66/144 sync processor (sync) (contd) 4.4.8.2 vertical output measurement the function of vertical pulse measurement is to: C capture the number of hsynco pulses during a low level of vsynco. C capture the number of hfback pulses during a low level of vfback (maximum accuracy). start the measurement by setting vacq in the cfgr. when the measurement is completed this bit is cleared by hardware. the vgenr and cfgr registers return the result. the algorithm is shown in figure 46 . hline = 2048 - (v11bits) hline maximum value = 2048 (even if real value is greater) v11bits = vgenr(8 msb) and q'2,q'1,q'0 (3 lsb). refer to figure 44 . note: in case of pre/post equalization pulses, set the 2fhinh bit in the cfgr register. 4.4.8.3 detection of pre equalization pulses this function uses two bits: C 2fhdet in polr register continuously updated by hardware C 2fhlat in latr register set by hardware when a higher frequency is detected and reset by soft- ware a measurement of the low level of hsynco is necessary before reading this information. note: reset the 2fhlat bit in the latr register on the third hsync pulse after the vsync pulse. figure 46. vertical output measurement vr02118b end vgenr & cfgr=result vacq=0? measure h lines disable v correction mode vcordis=1, vext=0 disable h internal generation hvgen=0 h & vsynco positive polarity necessary if signals are h/vsynco select h/vback or h/vsynco fbsel=0 or 1 vacq=1 start measurement no yes
st72774/st727754/st72734 67/144 sync processor (sync) (contd) 4.4.9 corrector mode in this mode, you can perform the following functions: C inhibit pre/post equalization pulses this removes all pre/post equalization pulses on the hsynco signal. the inhibition starts on the falling edge of hsynco and lasts for (((hgenr+1)/4)-2) s. the decrease of 2s (one minimum pulse width) avoids the removal of the next pulse of hsynco. procedure: 1. hsynco and vsynco polarities must be positive. 2. measure the low level of hsynco. 3. set the 2fhinh bit in the cfgr register. C extend vsynco pulse width by several scan lines this function can be also used to extend the video blanking signal. procedure: 1. hsynco and vsynco polarities must be positive. 2. set the 2fhinh bit in the cfgr register only if some pre/post equalizations pulses are detected. (2fhlat, 2fhdet flags). 3. the extension will be the number of hsynco periods set in the vgenr register. 4. reset the vcordis bit in the polr register. C extend vsynco width during all post equaliza- tion pulses. this function extends the vsynco pulse width when post equalization pulses are detected (2fhdet bit in the polr register and 2fhlat bit in the latr register). procedure: 1. hsynco and vsynco polarities must be positive. 2. set the 2fhinh bit in the cfgr register to remove pre/post equalization pulses. 3. measure the low level of hsynco. 4. update hgenr =(ffh - (hgenr + 1)) + 4 to add tolerance 5. write vgenr > 0. 6. reset the vcordis bit in the polr register 7. set the vext bit in the cfgr register. C extend vsynco pulse width during pre and post equalization pulses (for test only). this function allows extending the vsynco pulse width as long as equalization pulses are detected. (vsynco = vsynco + 2fhdet). procedure: 1. hsynco and vsynco polarities must be positive. 2. set the 2fhinh bit in the cfgr register to remove pre/post equalization pulses. 3. measure the low level of hsynco. 4. update hgenr =(ffh - (hgenr + 1)) + 4. 5. write vgenr > 0. 6. reset the vcordis bit in the polr register. 7. set the vext bit in the cfgr register. 8. set the 2fhen bit in the enr register. notes: 1. when corrector mode is active, the free-running frequencies generator and analyzer mode must be disabled. (hvgen=0 in enr register, hacq=0, vacq=0 in the cfgr register). 2. if vgenr=0, all vsynco correction functions are disabled except the 2fhen bit which must be cleared if vgenr = 0 or vcordis = 1.
st72774/st727754/st72734 68/144 sync processor (sync) (contd) 4.4.10 register description configuration register (cfgr) read/write reset value: 0000 0000 (00h) bit 7 = hacq horizontal sync analyzer mode set by software, reset by hardware when the measurement is done. the sync generator must be disabled (hvgen=0). 0 : measurement is done, the result can be read in hgenr. 1: start measuring hsynco/hfback low lev- el. bit 6 = vacq vertical sync analyzer mode set by software, reset by hardware when the measurement is done. the sync generator must be disabled (hvgen=0). 0: measurement is done, and the result can be read in vgenr. 1: start measuring the number of scan lines dur- ing vsynco/vfback low level. bit 5 = reserved. must be cleared. bit 4 = 2fhinh inhibition of pre/post equalization pulses. this function removes pre/post equalization pulses on hsynco signal. the sync generator and the horizontal sync analyzer must both be disabled (hvgen=hacq=0). 0: disable 1: enable bit 3 = vext vsynco pulse width extension in case of post-equalization pulses. the sync generator and the horizontal and vertical sync analyzer must be disabled (hvgen = 0, hacq = 0, vacq = 0, vcordis=0). vertical extension must be enabled (vgenr > 0 ). 0: disable 1: enable bits 2:0 = q2..q0 these are the read/write lsb of the vgenr 11-bit counter. refer to figure 44 . 70 hacq vacq - 2fhinh vext q2 q1 q0
st72774/st727754/st72734 69/144 sync processor (sync) (contd) mux control register (mcr) read/write reset value: 0010 0000 (20h) bit 7:6 = bp1, bp0 back porch pulse control bit 5 = fbsel vsynco/hsynco or vfback/ hfback analysis 0: hfback & vfback 1: hsynco & vsynco bit 4 = sci0 hsynci/csynci selection 0: hsynci 1: csynci bit 3:2 = hs1, hs0 horizontal signal selection these bits allow inversion of the hsynci/csynci note: in case of composite sync, if hsynco blanking is enabled (hinh=0 in the enr register), hs1 must = 1 (clampout after hsynco rising edge not al- lowed). bit 1 = vop vertical polarity control the vop bit inverts the vsynco sync signal. 0: no polarity inversion (vsync0 <- vsynci) 1: inversion enabled (vsync0 <- vsynci ) note: if at each vertical input capture the vpol bit is cop- ied by software on the vop bit, the vsynco signal will have a constant positive polarity. note: the internally extracted vsynco has always negative polarity. bit 0 = reserved. must always be cleared. 70 bp1 bp0 fbsel sci0 hs1 hs0 vop - bp1 bp0 back porch pulse width 0 0 no back porch, moire output selected 01 167ns back porch 10 ns 1 0 333ns back porch 10 ns 1 1 666ns back porch 10 ns hs1 hs0 hsynci selection mode 00 clampout after hsynco rising edge hsync0 <- (hsynci, csynci) 01 clampout after hsynco rising edge hsync0 <- (hsynci , csynci ) 10 clampout after hsynco falling edge hsync0 <- (hsynci , csynci ) 11 clampout after hsynco falling edge hsync0 <- (hsynci,csynci)
st72774/st727754/st72734 70/144 sync processor (sync) (contd) counter control register (ccr) read/write reset value: 0000 0000 (00h) bit 7 = pscd prescaler enable bit. 0: enable the prescaler by 256 1: disable the prescaler and reset it to 7fh. this also disables the icap2 event. bit 6:5 = lcv1, lcv0 vsynco extraction control bit 4:0 = cv4-cv0 counter captured value. these bits contain the counter captured value in different modes. in vsynco extraction mode, they contain the hsynci pulse-width measurement. polarity register (polr) bits 5-4 read only, other bits read/write reset value: 0000 1000 (08h) bit 7 = sog sync on green detector sog is set by hardware if csynci pulse is not included in the window between hsynci rising edge and hsynci falling edge + dt . cleared by software. table 19. sync on green window bit 6 = reserved, forced by hardware to 0. bit 5 = vpol vertical sync polarity (read only) 0: positive polarity 1: negative polarity note: if the vertical sync polarity is changing, the vpol bit will be updated after a typical delay of 4 msec. bit 4 = 2fhdet detection of pre/post equalization pulses (read only). this bit is continuously updated by hardware. it is valid when the sync generator and horizontal analyzer are disabled (hvgen = 0, hacq = 0). 0: none detected 1: pre/post equalization pulses detected bit 3 = hvsel alternate sync input select. this bit selects between the two sets of horizontal and vertical sync inputs 0: hsynci2 / vsynci2 1: hsynci1 / vsynci1 bit 2 = vcordis extension disable signal (extension with vgenr register) 0: enable 1: disable bit 1 = clpinv programmable clampout pulse polarity. 0: positive 1: negative bit 0 = blkinv programmable blanking polarity 0: negative 1: positive 70 pscd lcv1 lcv0 cv4 cv3 cv2 cv1 cv0 lcv1 lcv0 vsync0 control bits 00 normal mode counter capture on input falling edge 01 normal mode counter capture on input rising edge 10 extraction mode csynci/hsynci negative polarity cv4-0 = counter minimum threshold 11 extraction mode csynci/hsynci positive polarity cv4-0 = counter maximum threshold 70 sog 0 vpol 2fhdet hvsel vcordis clpinv blkinv window delay min. max. dt 165 ns 250 ns
st72774/st727754/st72734 71/144 sync processor (sync) (contd) latch register (latr) read/write reset value: 0000 0000 (00h) bit 7 = csyn detection of pulses on csynci set on falling edge of csynci cleared by software (by writing zero). bit 6 = hsyn detection of pulses on hsynci set on falling edge of hsynci1 or hsynci2 cleared by software (by writing zero). bit 5 = vsyn detection of pulses on vsynci set on falling edge of vsynci1 or vsynci2 cleared by software (by writing zero). bit 4 = hfly detection of pulses on hfback set on falling edge of hfback input cleared by software (by writing zero). bit 3 = vfly detection of pulses on vfback set on falling edge of vfback input cleared by software (by writing zero). bit 2 = uplat detection of the maximum value of 5-bit up/down counter. set when the 5 bit up/down counter reaches its maximum value (1fh or threshold) cleared by software (by writing zero). bit 1 = dwnlat detection of minimum value of 5- bit up/down counter. set when the 5 bit up/down counter reaches its minimum value (00 or threshold) cleared by software (by writing zero). note: dwnlat and uplat may be used for hsynci po- larity detection and composite sync detection as follows: bit 0 = 2fhlat equalization pulses latch. this bit may be used to detect pre/ postequalization pulses or a too high horizontal frequency. set by hardware when pre/post equalization pulses are detected. must be reset by software. it is valid when the sync generator and horizontal analyzer are disabled (hvgen = 0, hacq = 0) 70 csyn hsyn vsyn hfly vfly uplat dwnlat 2fhlat uplat dwnlat hsynci characteristics 0 0 no info 0 1 positive polarity 1 0 negative polarity 1 1 composite sync
st72774/st727754/st72734 72/144 sync processor (sync) (contd) horizontal sync generator register (hgenr) read/write reset value: 0000 0000 (00h) case hvgen = 1: generation mode in this mode, this register contains the hsync free- running frequency. the generated signal is: - pulse width: 2 s. - period ph = ((hgenr+1)/4) s. - polarity: positive note: the value in hgenr must be in the range [8..255] . case hvgen = 0: analyzer/corrector mode sub-case hacq = 1 : analyzer mode by setting hacq bit by software the analyzer mode starts. when hacq is cleared by hardware, hgenr returns the duration of hsynco/ hfback low level. the analysis should be done before corrector mode. sub-case hacq = 0: corrector mode in this mode, the final hsynco signal on the pin can be corrected in order to detect and inhibit pre/ post equalization pulses. vertical sync generator register (vgenr) read/write reset value: 0000 0000 (00h) case hvgen = 1 : generation mode in this mode, this register contains the vsync free- running frequency (11-bit value). the generated signal is: - pulse width: 4 * ph s (horizontal period). - period pv = ph * (v11bits) s. - polarity: positive note: the value in vgenr must be in the range [5..255] the vsync generation mode works as an 11-bit hor- izontal line counter (2047 scan lines per frame max.). the 3 lsb are in the cfgr register. refer to figure 44 . case hvgen = 0: analyzer/corrector mode sub-case vacq = 1: analyzer mode set the vacq bit to start analyzer mode. when vacq is cleared by hardware, vgenr/cfgr returns the number of scan lines during the vsynco/vfback low level period. sub-case vacq = 0: corrector mode vsynco pulse width is extended by vgenr scan lines. if vgenr = 0, all vsynco corrections are disabled. 70 msb lsb 70 msb lsb
st72774/st727754/st72734 73/144 sync processor (sync) (contd) enable register (enr) read/write reset value: 1100 0011 (c3h) bit 7 = synop hsynco, vsynco outputs enable 0: enabled 1: disabled bit 6 = clmpen clamping or moire output ena- ble 0: clamping or moire output (function of bp0, bp1) enabled 1: clamping or moire output disabled bit 5 = blken blanking output 0: disabled 1: enabled bit 4 = hvgen sync generation function 0: analyzer/corrector mode 1: generation of hsynco and vsynco free- running frequencies bit 3 = 2fhen vsynco extension vsynco is forced high when detecting pre- and post-equalization pulses. it is valid when the sync generator and analyzer are disabled (hvgen = 0, hacq = 0, vacq = 0). refer to the procedure in section 4.4.9 corrector mode . 0: disabled 1: enabled bit 2 = hinh hsynco blanking hsynco is blanked during the extracted vsynco pulse. 0: enabled 1: disabled bit 1 = hsin1 (read only) returns the hsynci1 pin level bit 0 = vsin1 (read only) returns the vsynci1 pin level table 20. summary of the main sync processor modes 70 synop clmpen blken hvgen 2fhen hinh hsin1 vsin1 sync processor mode synop hvsel hvgen hacq vacq dsub selected as inputs (hsynci1/vsynci1) --- 1 --- --- --- bnc selected as inputs (hsynci2/vsynci2) --- 0 --- --- --- dont drive the monitor with any sync signals 1 --- --- --- --- generate sync signals to drive the monitor hardware 0 --- 1 0 0 use the sync processor to drive the monitor hardware by incoming sync signals 0 --- 0 --- --- analyse the number of scan lines during one vertical frame --- -- 0 --- 1 analyse the hsync delay between two pulses --- --- 0 1 ---
st72774/st727754/st72734 74/144 sync processor (sync) (contd) table 21. sync register map and reset values address (hex.) register name 76543210 40 cfgr reset value hacq 0 vacq 0 - 0 2fhinh 0 vext 0 q2 0 q1 0 q0 0 41 mcr reset value bp1 0 bp0 0 fbsel 1 sci0 0 hs1 0 hs0 0 vop 0 - 0 42 ccr reset value pscd 0 lcv1 0 lcv0 0 cv4 0 cv3 0 cv2 0 cv1 0 cv0 0 43 polr reset value sog 0 0 0 vpol 0 2fhdet 0 hvsel 1 vcordis 0 clpinv 0 blkinv 0 44 latr reset value csyn 0 hsyn 0 vsyn 0 hfly 0 vfly 0 uplat 0 dwnlat 0 2fhlat 0 45 hgenr reset value msb 0000000 lsb 0 46 vgenr reset value msb 0000000 lsb 0 47 enr reset value synop 1 clmpen 1 blken 0 hvgen 0 2fhen 0 hinh 0 hsin1 1 vsin1 1
st72774/st727754/st72734 75/144 4.5 timing measurement unit (tmu) 4.5.1 introduction the timing measurement unit (tmu) allows the analysis of the current video timing characteristics in order to control display position and size. it consists of measuring the timing between the horizontal or vertical sync output signals and the active video signal input (av). 4.5.2 main features n horizontal or vertical timing measurement n oscillator clock f osc (24 or 12 mhz) used for horizontal measurement n horizontal sync signal (hsynco or hfback) and vertical sync signal (vsynco or vfback) used for all measurements n measurements performed on positive signals only n 11-bit counter n overflow detection 4.5.3 functional description the timing measurement unit is centered around an 11-bit counter. depending on the h_v bit of the control register, the tmu measures the horizontal or vertical video characteristics. for horizontal analysis (refer to figure 48 ): C obtain the minimum number of oscillator clock cycles (h1) between the falling edge of the horizontal sync signal (hsynco or hfback) and the first rising edge of the active video in- put (av), for all lines, between 2 consecutive vertical sync pulses. C obtain the minimum number of oscillator clock cycles (h2) between the last falling edge of the active video input (av) and the rising edge of the horizontal sync signal (hsynco or hf- back) for all lines, between 2 consecutive vertical sync pulses. note: horizontal measurement is inhibited during the high level of vsynco or vflyback. for vertical analysis (refer to figure 49 ): C obtain the minimum number of horizontal sync pulses (v1) between the falling edge of the vertical sync signal (vsynco or vf- back) and the first rising edge of the active video input, during 2 consecutive frames. figure 47. tmu block diagram st7 internal bus tmut1cr tmut2cr tmucsr 11 bit counter 11 8 8 3 3 t1[7:0] t2[7:0] t2[9] t2[8] t1[9] t1[8] start h_v control clock start stop hsynco or hfback (1) vsynco or vfback (1) av f osc t2[10] t1[10] comparator sup (from sync processor) note 1: selection between sync outputs or flyback inputs is made in miscr register (bit 6: fly_syn)
st72774/st727754/st72734 76/144 timing measurement unit (contd) C obtain the minimum number of horizontal sync output pulses (v2) between the last fall- ing edge of the active video input (av) and the rising edge of the vertical sync signal ( vsyn- co or vfback) during two 2 consecutive frames. the h_v bit selects horizontal or vertical measurement. this selection should be made prior to starting the measurement by setting the start bit. this bit is set by software but only cleared by hardware at the end of the measurement. when the measurement is finished (rising edge of av, horizontal or vertical sync signals), the results (t1,t2) are transferred into the corresponding registers (h1,h2) or (v1,v2). note: the values of the h1/h2 or v1/v2 registers are available only at the end of a measurement (after the start bit has been cleared). 4.5.3.1 horizontal measurement when the h_v bit = 1, and when the start bit is set by software, the measurement starts after the next vertical sync pulse. the tmu searches the minimum values of h1 and h2 until the rising edge of the next following vertical sync pulse. the start bit is then cleared by hardware. the values of the h1 and h2 registers are available only at the end of a measurement, in other words when the start bit is at 0. 4.5.3.2 vertical measurement when the h_v bit = 0 and, when the start bit is set by software, the tmu measures the minimum v1 and v2 values during 2 consecutive vertical frames. the start bit is then cleared by hardware. 4.5.3.3 special cases C if an overflow of the counter occurs during any of the measurements, the measured t1 or t2 val- ues will be 7ffh. C if the av signal is always low (no active video), the measured t1 or t2 values will also be 7ffh. C if t1 0 (av already high when the falling edge of the sync signal occurs), the measured t1 val- ue will be fixed to 1. C if t2 0 (av still high when the rising edge of the sync signal occurs), a specific t2 value will be re- turned. note: refer to application note an1183 for further de- tails. figure 48. horizontal measurement figure 49. vertical measurement hsynco or av h1 h2 h1 and h2 measured in oscillator clock periods note: hsynco or hfback must be positive. hfback vsynco or av v1 v2 v1 and v2 measured in horizontal pulses note: vsynco or vfback must be positive. vfback
st72774/st727754/st72734 77/144 timing measurement unit (contd) 4.5.4 register description control status register (tmucsr) bit 7:2 - read only bit 1:0 - read/write reset value: 1111 1100 (fch) bit 7:5 = t2[10:8] msb of t2 counter. most significant bits of the t2 counter value (see t2 counter register description). bit 4:2= t1[10:8] msb t1 counter . most significant bits of the t1 counter value (see t1 counter register description). bit 1 = h_v horizontal or vertical measurement. this bit is set and cleared by software to select the type of measurement. it cannot be modified while the start bit = 1 (measurement in progress). 0: vertical measurement. 1: horizontal measurement. bit 0 = start start measurement. this bit is set by software and cleared by hardware when the measurements are completed. it can not be cleared by software. 0: measurement done. 1: start measurement. t1 counter register (tmut1cr) read only reset value: 1111 1111 (ffh) this is an 8-bit register that contains the low part of the counter value. when a t1 measurement is finished (rising edge on av input), the 11-bit counter value is transferred to this register and to the t1[10:8] bits in the csr register. t1 is h1 value if the h_v bit = 1. t1 is v1 value if the h_v bit = 0. t2 counter register (tmut2cr) read only reset value: 1111 1111(ffh) this is an 8-bit register that contains the low part of the counter value. when a t2 measurement is finished (rising edge on the selected sync signal), the 11-bit counter value is transferred to this register and to the t2[10:8] bits in the csr register. t2 is h2 value if the h_v bit = 1. t2 is v2 value if the h_v bit = 0. 70 t2[10] t2[9] t2[8] t1[10] t1[9] t1[8] h_v start 70 t1[7] t1[0] 70 t2[7] t2[0]
st72774/st727754/st72734 78/144 timing measurement unit (contd) table 22. tmu register map and reset values address (hex.) register name 76543210 0e csr reset value t2[10] 1 t2[9] 1 t2[8] 1 t1[10] 1 t1[9] 1 t1[8] 1 h_v 0 start 0 0f t1cr reset value t1[7] 1111111 t1[0] 1 10 t2cr reset value t2[7] 1111111 t2[0] 1
st72774/st727754/st72734 79/144 4.6 usb interface (usb) 4.6.1 introduction the usb interface implements a low-speed function interface between the usb and the st7 microcontroller. it is a highly integrated circuit which includes the transceiver, 3.3 voltage regulator, sie and dma. no external components are needed apart from the external pull-up on usbdm for low speed recognition by the usb host. 4.6.2 main features n usb specification version 1.0 compliant n supports low-speed usb protocol n two or three endpoints (including default one) depending on the device (see device feature list and register map) n crc generation/checking, nrzi encoding/ decoding and bit-stuffing n usb suspend/resume operations n dma data transfers n on-chip 3.3v regulator n on-chip usb transceiver 4.6.3 functional description the block diagram in figure 50 , gives an overview of the usb interface hardware. for general information on the usb, refer to the universal serial bus specifications document available at http//:www.usb.org. serial interface engine the sie (serial interface engine) interfaces with the usb, via the transceiver. the sie processes tokens, handles data transmission/reception, and handshaking as required by the usb standard. it also performs frame formatting, including crc generation and checking. endpoints the endpoint registers indicate if the microcontroller is ready to transmit/receive, and how many bytes need to be transmitted. dma when a token for a valid endpoint is recognized by the usb interface, the related data transfer takes place, using dma. at the end of the transaction, an interrupt is generated. interrupts by reading the interrupt status register, application software can know which usb event has occurred. figure 50. usb block diagram cpu memory transceiver 3.3v voltage regulator sie endpoint dma interrupt address, and interrupts usbdm usbdp usbvcc 6 mhz registers registers data busses usbgnd
st72774/st727754/st72734 80/144 usb interface (contd) 4.6.4 register description dma address register (dmar) read / write reset value: undefined bits 7:0= da[15:8] dma address bits 15-8. see the description of bits da7-6 in the next register (idr). interrupt/dma register (idr) read / write reset value: xxxx 0000 (x0h) bits 7:6 = da[7:6] dma address bits 7-6. the software must write the start address of the dma memory area whose most significant bits are given by da15-da6. the remaining 6 address bits are set by hardware. see figure 51 . bits 5:4 = ep[1:0] endpoint number (read-only). these bits identify the endpoint which required attention. 00: endpoint 0 01: endpoint 1 10: endpoint 2 when a ctr interrupt occurs (see register istr) the software should read the ep bits to identify the endpoint which has sent or received a packet. bits 3:0 = cnt[3:0] byte count (read only). this field shows how many data bytes have been received during the last data reception. note: not valid for data transmission. figure 51. dma buffers 70 da15 da14 da13 da12 da11 da10 da9 da8 70 da7 da6 ep1 ep0 cnt3 cnt2 cnt1 cnt0 endpoint 0 rx endpoint 0 tx endpoint 2 rx endpoint 1 tx 000000 000111 001000 001111 010000 010111 011000 011111 da15-6,000000 endpoint 1 rx endpoint 2 tx 100000 100111 101000 101111
st72774/st727754/st72734 81/144 usb interface (contd) pid register (pidr) read only reset value: xx00 0000 (x0h) bits 7:6 = tp3-tp2 token pid bits 3 & 2 . usb token pids are encoded in four bits. tp3-tp2 correspond to the variable token pid bits 3 & 2. note: pid bits 1 & 0 have a fixed value of 01. when a ctr interrupt occurs (see register istr) the software should read the tp3 and tp2 bits to retrieve the pid name of the token received. the usb standard defines tp bits as: bit 5:0 reserved. forced by hardware to 0. interrupt status register (istr) read / write reset value: 0000 0000 (00h) when an interrupt occurs these bits are set by hardware. software must read them to determine the interrupt type and clear them after servicing. note: these bits cannot be set by software. bit 7 = reserved. forced by hardware to 0. bit 6 = dovr dma over/underrun . this bit is set by hardware if the st7 processor cant answer a dma request in time. 0: no over/underrun detected 1: over/underrun detected bit 5 = ctr correct transfer. this bit is set by hardware when a correct transfer operation is performed. the type of transfer can be determined by looking at bits tp3-tp2 in register pidr. the endpoint on which the transfer was made is identified by bits ep1-ep0 in register idr. 0: no correct transfer detected 1: correct transfer detected note: a transfer where the device sent a nak or stall handshake is considered not correct (the host only sends ack handshakes). a transfer is considered correct if there are no errors in the pid and crc fields, if the data0/data1 pid is sent as expect- ed, if there were no data overruns, bit stuffing or framing errors. bit 4 = err error. this bit is set by hardware whenever one of the errors listed below has occurred: 0: no error detected 1: timeout, crc, bit stuffing or nonstandard framing error detected bit 3 = iovr interrupt overrun. this bit is set when hardware tries to set err, esusp or sof before they have been cleared by software. 0: no overrun detected 1: overrun detected bit 2 = esusp end suspend mode . this bit is set by hardware when, during suspend mode, activity is detected that wakes the usb interface up from suspend mode. this interrupt is serviced by a specific vector. 0: no end suspend detected 1: end suspend detected bit 1 = reset usb reset. this bit is set by hardware when the usb reset sequence is detected on the bus. 0: no usb reset signal detected 1: usb reset signal detected note: the daddr, ep0ra, ep0rb, ep1ra, ep1rb, ep2ra and ep2rb registers are reset by a usb reset. 70 tp3tp2000000 tp3 tp2 pid name 00 out 10 in 1 1 setup 70 0 dovr ctr err iovr esusp reset sof
st72774/st727754/st72734 82/144 usb interface (contd) bit 0 = sof start of frame. this bit is set by hardware when a low-speed sof indication (keep-alive strobe) is seen on the usb bus. 0: no sof signal detected 1: sof signal detected note: to avoid spurious clearing of some bits, it is recom- mended to clear them using a load instruction where all bits which must not be altered are set, and all bits to be cleared are reset. avoid read-modify- write instructions like and , xor.. interrupt mask register (imr) read / write reset value: 0000 0000 (00h) bit 7 = reserved. forced by hardware to 0. bits 6:0 = these bits are mask bits for all interrupt condition bits included in the istr. whenever one of the imr bits is set, if the corresponding istr bit is set, and the i bit in the cc register is cleared, an interrupt request is generated. for an explanation of each bit, please refer to the corresponding bit description in istr. control register (ctlr) read / write reset value: 0000 0110 (06h) bits 7:4 = reserved. forced by hardware to 0. bit 3 = resume resume . this bit is set by software to wake-up the host when the st7 is in suspend mode. 0: resume signal not forced 1: resume signal forced on the usb bus. software should clear this bit after the appropriate delay. bit 2 = pdwn power down . this bit is set by software to turn off the 3.3v on- chip voltage regulator that supplies the external pull-up resistor and the transceiver. 0: voltage regulator on 1: voltage regulator off note: after turning on the voltage regulator, software should allow at least 3 s for stabilisation of the power supply before using the usb interface. bit 1 = susp suspend mode . this bit is set by software to enter suspend mode. 0: suspend mode inactive 1: suspend mode active when the hardware detects usb activity, it resets this bit (it can also be reset by software). bit 0 = fres force reset. this bit is set by software to force a reset of the usb interface, just as if a reset sequence came from the usb. 0: reset not forced 1: usb interface reset forced. the usb is held in reset state until software clears this bit, at which point a usb-reset interrupt will be generated if enabled. device address register (daddr) read / write reset value: 0000 0000 (00h) bit 7 = reserved. forced by hardware to 0. bits 6:0 = add[6:0] device address, 7 bits. software must write into this register the address sent by the host during enumeration. note: this register is also reset when a usb reset is re- ceived from the usb bus or forced through bit fres in the ctlr register. 70 0 dov rm ctr m err m iovr m esu spm res etm sof m 70 0 0 0 0 resume pdwn susp fres 70 0 add6 add5 add4 add3 add2 add1 add0
st72774/st727754/st72734 83/144 usb interface (contd) endpoint n register a (epnra) read / write reset value: 0000 xxxx (0xh) these registers ( ep0ra , ep1ra and ep2ra ) are used for controlling data transmission. they are also reset by the usb bus reset. note: endpoint 2 and the ep2ra register are not availa- ble on some devices (see device feature list and register map). bit 7 = st_out status out. this bit is set by software to indicate that a status out packet is expected: in this case, all nonzero out data transfers on the endpoint are stalled instead of being acked. when st_out is reset, out transactions can have any number of bytes, as needed. bit 6 = dtog_tx data toggle, for transmission transfers. it contains the required value of the toggle bit (0=data0, 1=data1) for the next transmitted data packet. this bit is set by hardware at the reception of a setup pid. dtog_tx toggles only when the transmitter has received the ack signal from the usb host. dtog_tx and also dtog_rx (see epnrb) are normally updated by hardware, at the receipt of a relevant pid. they can be also written by software. bits 5:4 = stat_tx[1:0] status bits, for transmission transfers. these bits contain the information about the endpoint status, which are listed below: these bits are written by software. hardware sets the stat_tx bits to nak when a correct transfer has occurred (ctr=1) related to a in or setup transaction addressed to this endpoint; this allows the software to prepare the next set of data to be transmitted. bits 3:0 = tbc[3:0] transmit byte count for endpoint n. before transmission, after filling the transmit buffer, software must write in the tbc field the transmit packet size expressed in bytes (in the range 0-8). 70 st_ out dtog _tx stat _tx1 stat _tx0 tbc 3 tbc 2 tbc 1 tbc 0 stat_tx1 stat_tx0 meaning 00 disabled: transmission transfers cannot be execut- ed. 01 stall : the endpoint is stalled and all transmission requests result in a stall handshake. 10 nak : the endpoint is naked and all transmission re- quests result in a nak hand- shake. 11 valid : this endpoint is ena- bled for transmission.
st72774/st727754/st72734 84/144 usb interface (contd) endpoint n register b (epnrb) read / write reset value: 0000 xxxx (0xh) these registers ( ep1rb and ep2rb ) are used for controlling data reception on endpoints 1 and 2. they are also reset by the usb bus reset. note: endpoint 2 and the ep2rb register are not availa- ble on some devices (see device feature list and register map). bit 7 = ctrl control. this bit should be 0. note: if this bit is 1, the endpoint is a control endpoint. (endpoint 0 is always a control endpoint, but it is possible to have more than one control endpoint). bit 6 = dtog_rx data toggle, for reception transfers . it contains the expected value of the toggle bit (0=data0, 1=data1) for the next data packet. this bit is cleared by hardware in the first stage (setup stage) of a control transfer (setup transactions start always with data0 pid). the receiver toggles dtog_rx only if it receives a correct data packet and the packets data pid matches the receiver sequence bit. bit 5:4 = stat_rx [1:0] status bits, for reception transfers. these bits contain the information about the endpoint status, which are listed in the following table: these bits are written by software. hardware sets the stat_rx bits to nak when a correct transfer has occurred (ctr=1) related to an out or setup transaction addressed to this endpoint, so the software has the time to elaborate the received data before acknowledging a new transaction. bits 3:0 = ea[3:0] endpoint address . software must write in this field the 4-bit address used to identify the transactions directed to this endpoint. usually ep1rb contains 0001 and ep2rb contains 0010. endpoint 0 register b (ep0rb) read / write reset value: 1000 0000 (80h) this register is used for controlling data reception on endpoint 0. it is also reset by the usb bus reset. bit 7 = forced by hardware to 1. bit 6:4 = refer to the epnrb register for a description of these bits. bit 3:0 = forced by hardware to 0. 70 ctrl dtog _rx stat _rx1 stat _rx0 ea3 ea2 ea1 ea0 stat_rx1 stat_rx0 meaning 00 disabled : reception transfers cannot be executed. 01 stall: the endpoint is stalled and all reception requests result in a stall handshake. 10 nak : the endpoint is na- ked and all reception re- quests result in a nak handshake. 11 valid : this endpoint is enabled for reception. 70 1 dtog rx stat rx1 stat rx0 0000
st72774/st727754/st72734 85/144 usb interface (contd) 4.6.5 programming considerations in the following, the interaction between the usb interface and the application program is described. apart from system reset, action is always initiated by the usb interface, driven by one of the usb events associated with the interrupt status register (istr) bits. 4.6.5.1 initializing the registers at system reset, the software must initialize all registers to enable the usb interface to properly generate interrupts and dma requests. 1. initialize the dmar, idr, and imr registers (choice of enabled interrupts, address of dma buffers). refer the paragraph titled initializing the dma buffers. 2. initialize the ep0ra and ep0rb registers to enable accesses to address 0 and endpoint 0 to support usb enumeration. refer to the para- graph titled endpoint initialization. 3. when addresses are received through this channel, update the content of the daddr. 4. if needed, write the endpoint numbers in the ea fields in the ep1rb and ep2rb register. 4.6.5.2 initializing dma buffers the dma buffers are a contiguous zone of memory whose maximum size is 48 bytes. they can be placed anywhere in the memory space, typically in ram, to enable the reception of messages. the 10 most significant bits of the start of this memory area are specified by bits da15- da6 in registers dmar and idr, the remaining bits are 0. the memory map is shown in figure 51 . each buffer is filled starting from the bottom (last 3 address bits=000) up. 4.6.5.3 endpoint initialization to be ready to receive: set stat_rx to valid (11b) in ep0rb to enable reception. to be ready to transmit: 1. write the data in the dma transmit buffer. 2. in register epnra, specify the number of bytes to be transmitted in the tbc field 3. enable the endpoint by setting the stat_tx bits to valid (11b) in epnra. note: once transmission and/or reception are enabled, registers epnra and/or epnrb (respectively) must not be modified by software, as the hardware can change their value on the fly. when the operation is completed, they can be accessed again to enable a new operation. 4.6.5.4 interrupt handling start of frame (sof) the interrupt service routine must monitor the sof events and measure the interval between each sof event. if 3ms pass without a sof event, the software should set the usb interface to suspend mode. usb reset (r eset) when this event occurs, the daddr register is reset, and communication is disabled in all endpoint registers (the usb interface will not respond to any packet). software is responsible for reenabling endpoint 0 within 10 ms of the end of reset. to do this you set the stat_rx bits in the ep0rb register to valid. end suspend (esusp) the cpu is alerted by activity on the usb, which causes an esusp interrupt. correct transfer (ctr) 1. when this event occurs, the hardware automat- ically sets the stat_tx or stat_rx to nak. note: every valid endpoint is naked until software clears the ctr bit in the istr register, independently of the endpoint number addressed by the transfer which generated the ctr interrupt. note: if the event triggering the ctr interrupt is a setup transaction, both stat_tx and stat_rx are set to nak. 2. read the pidr to obtain the token and the idr to get the endpoint number related to the last transfer. note: when a ctr interrupt occurs, the tp3-tp2 bits in the pidr register and ep1-ep0 bits in the idr reg- ister stay unchanged until the ctr bit in the istr register is cleared. 3. clear the ctr bit in the istr register.
st72774/st727754/st72734 86/144 usb interface (contd) table 23. usb register map and reset values address (hex.) register name 76 5 43210 25 pidr reset value tp3 x tp2 x 0 0 0 0 rx_sez 0 rxd 0 0 0 0 0 26 dmar reset value da15 x da14 x da13 x da12 x da11 x da10 x da9 x da8 x 27 idr reset value da7 x da6 x ep1 x ep0 x cnt3 0 cnt2 0 cnt1 0 cnt0 0 28 istr reset value susp 0 dovr 0 ctr 0 err 0 iovr 0 esusp 0 reset 0 sof 0 29 imr reset value suspm 0 dovrm 0 ctrm 0 errm 0 iovrm 0 esuspm 0 resetm 0 sofm 0 2a ctlr reset value 0 0 0 0 0 0 0 0 resume 0 pdwn 1 fsusp 1 fres 0 2b daddr reset value 0 0 add6 0 add5 0 add4 0 add3 0 add2 0 add1 0 add0 0 2c ep0ra reset value st_out 0 dtog_tx 0 stat_tx1 0 stat_tx0 0 tbc3 x tbc2 x tbc1 x tbc0 x 2d ep0rb reset value 1 1 dtog_rx 0 stat_rx1 0 stat_rx0 0 0 0 0 0 0 0 0 0 2e ep1ra reset value st_out 0 dtog_tx 0 stat_tx1 0 stat_tx0 0 tbc3 x tbc2 x tbc1 x tbc0 x 2f ep1rb reset value ctrl 0 dtog_rx 0 stat_rx1 0 stat_rx0 0 ea3 x ea2 x ea1 x ea0 x 30 ep2ra reset value st_out 0 dtog_tx 0 stat_tx1 0 stat_tx0 0 tbc3 x tbc2 x tbc1 x tbc0 x 31 ep2rb reset value ctrl 0 dtog_rx 0 stat_rx1 0 stat_rx0 0 ea3 x ea2 x ea1 x ea0 x
st72774/st727754/st72734 87/144 4.7 i2c single master bus interface (i2c) 4.7.1 introduction the i 2 c bus interface serves as an interface between the microcontroller and the serial i 2 c bus. it provides single master functions, and controls all i 2 c bus-specific sequencing, protocol and timing. it supports fast i2c mode (400khz). 4.7.2 main features C parallel bus /i 2 c protocol converter C interrupt generation C standard i 2 c mode/fast i 2 c mode C 7-bit addressing n i 2 c single master mode C end of byte transmission flag C transmitter/receiver flag C clock generation 4.7.3 general description in addition to receiving and transmitting data, this interface converts it from serial to parallel format and vice versa, using either an interrupt or polled handshake. the interrupts are enabled or disabled by software. the interface is connected to the i 2 c bus by a data pin (sdai) and by a clock pin (scli). it can be connected both with a standard i 2 c bus and a fast i 2 c bus. this selection is made by software. mode selection the interface can operate in the two following modes: C master transmitter/receiver by default, it is idle. the interface automatically switches from idle to master after it generates a start condition and from master to idle after it generates a stop condition. communication flow the interface initiates a data transfer and generates the clock signal. a serial data transfer always begins with a start condition and ends with a stop condition. both start and stop conditions are generated by software. data and addresses are transferred as 8-bit bytes, msb first. the first byte following the start condition is the address byte. a 9th clock pulse follows the 8 clock cycles of a byte transfer, during which the receiver must send an acknowledge bit to the transmitter. refer to figure 52 . figure 52. i 2 c bus protocol scl sda 12 8 9 msb ack stop start condition condition vr02119b
st72774/st727754/st72734 88/144 i2c single master bus interface (contd) acknowledge may be enabled and disabled by software. the speed of the i 2 c interface may be selected between standard (0-100khz) and fast i 2 c (100- 400khz). sda/scl line control transmitter mode: the interface holds the clock line low before transmission to wait for the microcontroller to write the byte in the data register. receiver mode: the interface holds the clock line low after reception to wait for the microcontroller to read the byte in the data register. the scl frequency (f scl ) is controlled by a programmable clock divider which depends on the i 2 c bus mode. when the i2c cell is enabled, the sda and scl ports must be configured as floating open-drain output or floating input. in this case, the value of the external pull-up resistance used depends on the application. when the i2c cell is disabled, the sda and scl ports revert to being standard i/o port pins. figure 53. i 2 c interface block diagram data register (dr) data shift register clock control register (ccr) status register 1 (sr1) control register (cr) sdai scli control logic status register 2 (sr2) interrupt clock control data control scl sda
st72774/st727754/st72734 89/144 i2c single master bus interface (contd) 4.7.4 functional description (master mode) refer to the cr, sr1 and sr2 registers in section 4.7.5 . for the bit definitions. by default the i 2 c interface operates in idle mode (m/idl bit is cleared) except when it initiates a transmit or receive sequence. to switch from default idle mode to master mode a start condition generation is needed. start condition and transmit slave address setting the start bit causes the interface to switch to master mode (m/idl bit set) and generates a start condition. once the start condition is sent: C the evf and sb bits are set by hardware with an interrupt if the ite bit is set. then the master waits for a read of the sr1 register followed by a write in the dr register with the slave address byte, holding the scl line low (see figure 54 transfer sequencing ev1). then the slave address byte is sent to the sda line via the internal shift register. after completion of this transfer (and acknowledge from the slave if the ack bit is set): C the evf bit is set by hardware with interrupt generation if the ite bit is set. then the master waits for a read of the sr1 register followed by a write in the cr register (for example set pe bit), holding the scl line low (see figure 54 transfer sequencing ev2). next the master must enter receiver or transmitter mode. master receiver following the address transmission and after sr1 and cr registers have been accessed, the master receives bytes from the sda line into the dr register via the internal shift register. after each byte the interface generates in sequence: C acknowledge pulse if if the ack bit is set C evf and btf bits are set by hardware with an in- terrupt if the ite bit is set. then the interface waits for a read of the sr1 register followed by a read of the dr register, holding the scl line low (see figure 54 transfer sequencing ev3). to close the communication: before reading the last byte from the dr register, set the stop bit to generate the stop condition. the interface goes automatically back to idle mode (m/idl bit cleared). note: in order to generate the non-acknowledge pulse af- ter the last received data byte, the ack bit must be cleared just before reading the second last data byte. master transmitter following the address transmission and after sr1 register has been read, the master sends bytes from the dr register to the sda line via the internal shift register. the master waits for a read of the sr1 register followed by a write in the dr register, holding the scl line low (see figure 54 transfer sequencing ev4). when the acknowledge bit is received, the interface sets: C evf and btf bits with an interrupt if the ite bit is set. to close the communication: after writing the last byte to the dr register, set the stop bit to generate the stop condition. the interface goes automatically back to idle mode (m/idl bit cleared). error case C af : detection of a non-acknowledge bit. in this case, the evf and af bits are set by hardware with an interrupt if the ite bit is set. to resume, set the start or stop bit. note: the scl line is not held low.
st72774/st727754/st72734 90/144 i2c single master bus interface (contd) figure 54. transfer sequencing legend: s=start, p=stop, a=acknowledge, na=non-acknowledge evx=event (with interrupt if ite=1) ev1: evf=1, sb=1, cleared by reading sr1 register followed by writing dr register. ev2: evf=1, cleared by reading sr1 register followed by writing cr register (for example pe=1). ev3: evf=1, btf=1, cleared by reading sr1 register followed by reading dr register. ev4: evf=1, btf=1, cleared by reading sr1 register followed by writing dr register. figure 55. event flags and interrupt generation master receiver: master transmitter: s address a data1 a data2 a ..... datan na p ev1 ev2 ev3 ev3 ev3 s address a data1 a data2 a ..... datan a p ev1 ev2 ev4 ev4 ev4 ev4 btf sb af evf interrupt ite * * evf can also be set by ev2 or an error from the sr2 register. *
st72774/st727754/st72734 91/144 i2c single master bus interface (contd) 4.7.5 register description i 2 c control register (cr) read / write reset value: 0000 0000 (00h) bit 7:6 = reserved. forced to 0 by hardware. bit 5 = pe peripheral enable. this bit is set and cleared by software. 0: peripheral disabled 1: master capability note: when pe=0, all the bits of the cr register and the sr register except the stop bit are reset. all outputs are released while pe=0 note: when pe=1, the corresponding i/o pins are select- ed by hardware as alternate functions. note: to enable the i 2 c interface, write the cr register twice with pe=1 as the first write only activates the interface (only pe is set). bit 4 = reserved. forced to 0 by hardware. bit 3 = start generation of a start condition . this bit is set and cleared by software. it is also cleared by hardware when the interface is disabled (pe=0) or when the start condition is sent (with interrupt generation if ite=1). in master mode: 0: no start generation 1: repeated start generation in idle mode: 0: no start generation 1: start generation when the bus is free bit 2 = ack acknowledge enable. this bit is set and cleared by software. it is also cleared by hardware when the interface is disabled (pe=0). 0: no acknowledge returned 1: acknowledge returned after a data byte is re- ceived bit 1 = stop generation of a stop condition . this bit is set and cleared by software. it is also cleared by hardware when the interface is disabled (pe=0) or when the stop condition is sent. in master mode only: 0: no stop generation 1: stop generation after the current byte transfer or after the current start condition is sent. bit 0 = ite interrupt enable. this bit is set and cleared by software and cleared by hardware when the interface is disabled (pe=0). 0: interrupts disabled 1: interrupts enabled refer to figure 55 for the relationship between the events and the interrupt. scl is held low when the sb or btf flags or an ev2 event (see figure 54 ) is detected. 70 0 0 pe 0 start ack stop ite
st72774/st727754/st72734 92/144 i2c single master bus interface (contd) i 2 c status register 1 (sr1) read only reset value: 0000 0000 (00h) bit 7 = evf event flag. this bit is set by hardware as soon as an event occurs. it is cleared by software reading sr2 register in case of error event or as described in figure 54 . it is also cleared by hardware when the interface is disabled (pe=0). 0: no event 1: one of the following events has occurred: C btf=1 (byte received or transmitted) C sb=1 (start condition generated) C af=1 (no acknowledge received after byte transmission if ack=1) C address byte successfully transmitted. bit 6 = reserved. forced to 0 by hardware. bit 5 = tra transmitter/receiver. when btf is set, tra=1 if a data byte has been transmitted. it is cleared automatically when btf is cleared. it is also cleared by hardware when the interface is disabled (pe=0). 0: data byte received (if btf=1) 1: data byte transmitted bit 4 = reserved. forced to 0 by hardware. bit 3 = btf byte transfer finished. this bit is set by hardware as soon as a byte is correctly received or transmitted with interrupt generation if ite=1. it is cleared by software reading sr1 register followed by a read or write of dr register. it is also cleared by hardware when the interface is disabled (pe=0). C following a byte transmission, this bit is set after reception of the acknowledge clock pulse. in case an address byte is sent, this bit is set only after the ev2 event (see figure 54 ). btf is cleared by reading sr1 register followed by writ- ing the next byte in dr register. C following a byte reception, this bit is set after transmission of the acknowledge clock pulse if ack=1. btf is cleared by reading sr1 register followed by reading the byte from dr register. the scl line is held low while btf=1. 0: byte transfer not done 1: byte transfer succeeded bit 2 = reserved. forced to 0 by hardware. bit 1 = m/idl master/idle. this bit is set by hardware as soon as the interface is in master mode (writing start=1). it is cleared by hardware after generating a stop condition on the bus. it is also cleared when the interface is disabled (pe=0). 0: idle mode 1: master mode bit 0 = sb start bit generated. this bit is set by hardware as soon as the start condition is generated (following a write start=1). an interrupt is generated if ite=1. it is cleared by software reading sr1 register followed by writing the address byte in dr register. it is also cleared by hardware when the interface is disabled (pe=0). 0: no start condition 1: start condition generated 70 evf 0 tra 0 btf 0 m/idl sb
st72774/st727754/st72734 93/144 i2c single master bus interface (contd) i 2 c status register 2 (sr2) read only reset value: 0000 0000 (00h) bit 7:5 = reserved. forced to 0 by hardware. bit 4 = af acknowledge failure . this bit is set by hardware when no acknowledge is returned. an interrupt is generated if ite=1. it is cleared by software reading sr2 register or by hardware when the interface is disabled (pe=0). the scl line is not held low while af=1. 0: no acknowledge failure 1: acknowledge failure bit 3:0 = reserved. forced to 0 by hardware. i 2 c clock control register (ccr) read / write reset value: 0000 0000 (00h) bit 7 = fm/sm fast/standard i 2 c mode. this bit is set and cleared by software. it is not cleared when the interface is disabled (pe=0). 0: standard i 2 c mode 1: fast i 2 c mode bit 6:0 = cc6-cc0 7-bit clock divider. these bits select the speed of the bus (f scl ) depending on the i 2 c mode. they are not cleared when the interface is disabled (pe=0). C standard mode (fm/sm=0): f scl <= 100khz f scl = f cpu /(2x([cc6..cc0]+2)) C fast mode (fm/sm=1): f scl > 100khz f scl = f cpu /(3x([cc6..cc0]+2)) note: the programmed f scl assumes no load on scl and sda lines. i 2 c data register ( dr) read / write reset value: 0000 0000 (00h) bit 7:0 = d7-d0 8-bit data register. these bits contains the byte to be received or transmitted on the bus. C transmitter mode: byte transmission start auto- matically when the software writes in the dr reg- ister. C receiver mode: the first data byte is received au- tomatically in the dr register using the least sig- nificant bit of the address. then, the next data bytes are received one by one after reading the dr register. 70 000af0000 70 fm/sm cc6 cc5 cc4 cc3 cc2 cc1 cc0 70 d7 d6 d5 d4 d3 d2 d1 d0
st72774/st727754/st72734 94/144 i2c single master bus interface (contd) table 24. i 2 c register map address (hex.) register name 765 4 3210 5f cr reset value 0 0 pe 00 start 0 ack 0 stop 0 ite 0 5e sr1 reset value evf 00 tra 00 btf 00 m/idl 0 sb 0 5d sr2 reset value 0 0 0 af 00000 5c ccr reset value fm/sm 0 cc6 0 cc5 0 cc4 0 cc3 0 cc2 0 cc1 0 cc0 0 59 dr reset value dr7 0 dr6 0 dr5 0 dr4 0 dr3 0 dr2 0 dr1 0 dr0 0
st72774/st727754/st72734 95/144 4.8 ddc interface (ddc) 4.8.1 introduction the ddc (display data channel) bus interface is mainly used by the monitor to identify itself to the video controller, by the monitor manufacturer to perform factory alignment, and by the user to adjust the monitors parameters. the ddc interface consists of two parts: n a fully hardware-implemented interface, supporting ddc1 and ddc2b (vesa specification 3.0 compliant). it accesses the st7 on-chip memory directly through a built-in dma engine. n a second interface, supporting the slave i 2 c functions for handling ddc/ci mode (ddc2bi), factory alignment or enhanced ddc (eddc) by software. 4.8.2 ddc interface features 4.8.2.1 hardware ddc1/2b interface features n full hardware support for ddc1/2b communications (vesa specification versions 2 and 3) n hardware detection of ddc2b addresses a0h/ a1h and optionally a2h/a3h (p&d) or a6h/a7h (fpdi-2) n separate mapping of edid version 1 (128 bytes) and edid version 2 (256 bytes) when both must coexist n support for error recovery mechanism n detection of misplaced start and stop conditions n i 2 c byte, random and sequential read modes n dma transfer from any memory location and to ram n automatic memory address incrementation n end of data downloading flag and interrupt capability 4.8.2.2 ddc/ci - factory interface features general i 2 c features: C parallel bus /i 2 c protocol converter C interrupt generation C standard i 2 c mode/fast i 2 c mode C 7-bit addressing i 2 c slave features: Ci 2 c bus busy flag C start bit detection flag C detection of misplaced start or stop condition C transfer problem detection C address matched detection C programmable address detection and/or hardware detection of enhanced ddc (ed- dc) addresses (60h/61h) C end of byte transmission flag C transmitter/receiver flag C stop condition detection figure 56. ddc interface overview sdad scld vsynci sda scl vsync hardware ddc1/2b interface i2c slave interface (ddc/ci - factory alignment) vsynci2 vsync2
st72774/st727754/st72734 96/144 ddc interface (contd) figure 57. ddc interface block diagram data register (dr) data shift register comparator status register 1 (sr1) ddc/ci-factory control register (cr) control logic status register 2 (sr2) interrupt data control scld sdad (ddc/ci (for monitor adjustment and control) ddc1/2b (for monitor identification) address high register (ahr) data control own address register (oar) ddc address low register (alr) control logic ddc1/2b interrupt hwddc controller dma control logic address/data data shift register ddc1/2b control register (dcr) vsynci vsynci2 bit in miscr register hardware address
st72774/st727754/st72734 97/144 ddc interface (contd) 4.8.3 signal description serial data (sda) the sda bidirectional pin is used to transfer data in and out of the device. it is an open-drain output that may be or-wired with other open-drain or open-collector pins. an external pull-up resistor must be connected to the sda line. its value depends on the load of the line and the transfer rate. serial clock (scl) the scl input pin is used to synchronize all data in and out of the device when in i 2 c bidirectional mode. an external pull-up resistor must be connected to the scl line. its value depends on the load of the line and the transfer rate. note: when the ddc1/2b and ddc/ci-factory interfaces are disabled (hwpe bit=0 in the dcr register and pe bit=0 in the cr register), sda and scl pins re- vert to standard i/o pins. transmit-only clock (vsync/vsync2) the vsync input pins are used to synchronize all data in and out of the device when in transmit-only mode. these pins are only used by the ddc1/2b interface (when in ddc1 mode).
st72774/st727754/st72734 98/144 ddc interface (contd) 4.8.4 i 2 c bus protocol a standard i 2 c communication is normally based on four parts: start condition, device slave address transmission, data transfer and stop condition. they are described brielfly in the following section and illustrated in figure 58 (for more details, refer to the i 2 c bus specification). 4.8.4.1 start condition when the bus is free (both scl and sda lines are at a high level), a master can initiate a communication by sending a start signal. this signal is defined as a high-to-low transition of sda while scl is stable high. the bus is considered to be busy after a start condition. this start condition must precede any command for data transfer. 4.8.4.2 slave address transmission the first byte following a start condition is the slave address transmitted by the master. this address is 7-bit long followed by an 8th bit (least significant bit: lsb) which is the data direction bit (r/w bit). C a 0 indicates a transmission (write) from the master to the slave. C a 1 indicates a request for data (read) from the slave to the master. if a slave device is present on the bus at the given address, an acknowledge will be generated on the 9th clock pulse. 4.8.4.3 data transfer once the slave address is acknowledged, the data transfer can proceed in the direction given by the r/w bit sent in the address. data is transferred with the most significant bit (msb) first. data bits can be changed only when scl is low and must be held stable when scl is high. one complete data byte transfer requires 9 clock pulses: 8 bits + 1 acknowledge bit. 4.8.4.4 acknowledge bit (ack / nack) every byte put on the sda line is 8-bit long followed by an acknowledge bit. this bit is used to indicate a successful data transfer. the bus transmitter, either master or slave, releases the sda line during the 9th clock period (after sending all 8 bits of data), then: C to generate an acknowledge (ack) of the cur- rent byte, the receiver pulls the sda line low. C to generate a no-acknowledge (nack) of the current byte, the receiver releases the sda line (hence at a high level). 4.8.4.5 stop condition a stop condition is defined by a low-to-high transition of sda while scl is stable high. it ends the communication between the interface and the bus master. figure 58. i 2 c signal diagram sda scl start ack a0h device slave address 00h data address ack ack data1(b0h) datan(f0h) ack stop write data to i2c device (slave address a0h) sda scl start ack a1h device slave address data1(00h) ack ack data2(b0h) datan(f0h) nack stop read data from i2c device (slave address a1h)
st72774/st727754/st72734 99/144 ddc interface (contd) 4.8.5 ddc standard the ddc standard is divided in several data transfer protocols: ddc1, ddc2b, ddc/ci. for ddc1/2b, refer to the vesa ddc standard v3.0 specification. for ddc/ci refer to the vesa ddc commands interface v1.0 C ddc1 is a uni-directional transmission of edid v1 (128 bytes) from display to host clocked by vsynci. C ddc2b is a uni-directional channel from display to host. the host computer uses base-level i 2 c commands to read the edid data from the dis- play which is always in slave mode. specific types of display contain edid at fixed i 2 c device addresses within the device (refer to table 25 ). C ddc/ci is a bi-directional channel between the host computer and the display. the ddc/ci of- fers a display control interface based on i 2 c bus. it includes the ddc2bi and ddc2ab standards. note: the ddc2ab standard is no longer handled by the interface. 4.8.5.1 ddc1/2b interface 4.8.5.1.1 functionnal description refer to the dcr, ahr registers in section 4.8.6 . for the bit definitions. the ddc1/2b interface acts as an i/o interface between a ddc bus and the microcontroller memory. in addition to receiving and transmitting serial data, this interface directly transfers parallel data to and from memory using a dma engine, only halting cpu activity for two clock cycles during each byte transfer. the interface supports by hardware: C two ddc communication protocols called ddc1 and ddc2b. C write operations into ram. C read operations from ram. in ddc1, the interface reads sequential edid v1 data bytes from the microcontroller memory, and transmits them on sda synchronized with vsync. in ddc2b mode, it operates in i 2 c slave mode. the ddc1/2b interface supports several ddc versions configured using the cf[2:0] bits in the dcr register which can only be changed while the interface is disabled (hwpe bit=0 in the dcr register). they define which edid structure version is used and which device addresses are recognized. depending on the ddc version, one or two device address pairs will be recognized and the corresponding edid structure will be validated (refer to table 25 ): C ddc v2 (cf2=0,cf1=0,cf0=0) : ddc1 is ena- bled and device addresses a0h/a1h are recog- nized. edid v1 is used. C ddc v2 (cf2=1,cf1=0,cf0=0) : ddc1 is disa- bled and device addresses a0h/a1h are recog- nized. edid v1 is used. C plug and display (cf2=0,cf1=0,cf0=1) : ddc1 is disabled and device addresses a2h/ a3h are recognized. edid v2 is used. C plug and display + ddc v2 (cf2=0,cf1=1, cf0=0) : ddc1 is enabled and device addresses a0h/a1h and a2h/a3h are recognized. both edid structures v1 and v2 are used. C plug and display + ddc v2 (cf2=1,cf1=1, cf0=0) : ddc1 is disabled and device addresses a0h/a1h and a2h/a3h are recognized. both edid structures v1 and v2 are used. C fpdi (cf2=0,cf1=1, cf0=1) : ddc1 is disabled and device addresses a6h/a7h are recognized. edid v2 is used. table 25. valid device addresses and edid structure device address cf2 bit cf1 bit cf0 bit transfer type edid v1: a0h / a1h = 1010 000x x x 0 128-byte edid structure write/read edid v2: a2h / a3h = 1010 001x 001 256-byte edid structure write/read 010 110 edid v2: a6h / a7h = 1010 011x 1 1 1 256-byte edid structure write/read reserved 1 x 1 reserved
st72774/st727754/st72734 100/144 ddc interface (contd) the write and read operations allow the edid data to be downloaded during factory alignment (for example). writes to the memory by the dma engine can be inhibited by means of the wp bit in the dcr register. a write of the last data structure byte sets a flag and may be programmed to generate an interrupt request. the data address (sub-address) is either the second byte of write transfers or is pointed to by the internal address counter automatically incremented after each byte transfer. physical address mapping of the data structure within the memory space is performed with a dedicated register accessible by software. 4.8.5.1.2 mode description ddc1 mode: this mode is only enabled when the ddc v2 or p&d-ddc v2 standards are validated. it transmits only the edid v1 data (128 bytes). to switch the ddc1/2b interface to ddc1 mode, software must first clear the cf0 bit in the dcr register while the hwpe bit=0 and then set the hwpe bit to enable the ddc1/2b interface. a proper initialization sequence (see figure 59 ) must supply nine clock pulses on the vsynci pin in order to internally synchronize the device. during this initialization sequence, the sda pin is in high impedance. on the rising edge of the 10th pulse applied on vsynci, the device outputs on sda the most significant (msb) bit of the byte located at data address 00h. a byte is clocked out by means of 9 clock pulses on vsync, 8 clock pulses for the data byte itself and an extra pulse for a dont care bit. as long as scl is not held low, each byte of the memory array is transmitted serially on sda. the internal address counter is incremented automatically until the last byte is transmitted. then, it rolls over to relative location 00h. the physical mapping of the data structure depends on the configuration and on the content of the ahr register which can be set by software (see figure 60 ). figure 59. ddc1 waveforms vsync sda 12 89 bit 7 10 11 pe scl bit 6 alr 00h xx vsync sda bit 7 pe scl bit 6 alr 00h 7fh bit 7 bit 6 bit 0
st72774/st727754/st72734 101/144 ddc interface (contd) figure 60. mapping of ddc1 data structure ddc2b transition mode: this mode avoids the display switching to ddc2b mode if spurious noise is detected on scl while the host is in ddc1 mode. when the ddc1/2b interface is in ddc1 mode and detects a falling edge on scl, it enters the transition state (see figure 61 ). if a valid i 2 c sequence (start followed by a valid device address for cf0 =0 (see table 25 )) is not received within either 128 vsync pulses or a period of approximately 2 seconds, then the interface will revert to ddc1 mode at the edid start address. if the interface decodes a valid ddc2b device address, it will lock into ddc2b mode and subsequently disregard vsynci. when in transition mode, the vsync pulse counter or the 2-sec. timeout counter is reset by any activity on the scl line. figure 61. transition mode waveforms ahr alr 0 7 8 15 addr pointer 0000h ffffh 256 * ahr alr 128-byte data 256 bytes structure msb of alr is always 0 ahr[7:1] alr 0 7 8 15 addr pointer 0000h ffffh 512 * ahr[7:1] 256 bytes 9 1 alr 128-byte data 256 bytes structure ddc v2 mode: cf[1:0] bits = 00b ddc v2 + p&d mode: cf[1:0] bits = 10b reserved - lsb of ahr is ignored and taken as 1 - msb of alr is always 0 notes: note: 6 0 vsync sda scl alr 00h ddc1 mode transition mode 01h
st72774/st727754/st72734 102/144 ddc interface (contd) ddc2b mode: the ddc1/2b interface enters ddc2b mode either from the transition state or from the initial state if software sets the hwpe bit while p&d only or fpdi-2 mode is selected. once in ddc2b mode, the interface always acts as a slave following the protocol described in figure 62 . the ddc1/2b interface continuously monitors the sda and scl lines for a start condition and will not respond (no acknowledge) until one is found. a stop condition at the end of a read command (after a nack) forces the stand-by state. a stop condition at the end of a write command triggers the internal dma write cycle. the interface samples the sda line on the rising edge of scl and outputs data on the falling edge of scl. in any case sda can only change when scl is low. figure 62. ddc2b protocol (example) sda scl start ack a0h device slave 00h data address ack start a1h data1 ack datan nack stop stop address device slave address 128 / 256 bytes edid legend: italics = data / control signal from display ack bold = data / control signal from host
st72774/st727754/st72734 103/144 figure 63. ddc1/2b operation flowchart sda hi-z vsync counter = 0 start 2-sec timer n y scl n received valid device address? y n vsync counter += 1 counter = 128 or timer expired ? send next bit relative address (alr) = 0 wait for hwpe = 1 vsync counter = 0 re-start 2-sec timer y y y n n ddc1 mode ddc2b mode transition mode hwpe bit = 0 vsync scl cf0 = 0 vsync n y y n received valid device address? n respond to command send acknowledge y relative address (alr) = 0 cf2 = 0 ? and
st72774/st727754/st72734 104/144 ddc interface (contd) edid data structure mapping: an internal address pointer defines the memory location being addressed. it is made of two 8-bit registers ahr and alr. ahr is initialized by software. it defines the 256- byte block within the 64k address space containing the data structure. alr is loaded with the data address sent by the master after a write device address. it defines the byte within the data structure currently addressed. alr is reset upon entry into the ddc2b mode. one exception to this arrangement is when the cf[1:0] bits = 10b. in this case the two edid versions must coexist at non-overlapping addresses. the lsb of ahr is therefore ignored and automatically set to 1 to address the 128-byte edid and set to 0 to address its 256-byte counterpart (see figure 64 ). figure 64. mapping of ddc2b data structure ahr alr 0 7 8 15 addr pointer 0000h ffffh 128-byte data 256 bytes structure 0000h ffffh 256 bytes 0000h ffffh alr 256-byte data 256 bytes structure 128-byte data structure a0h/a1h a0h/a1h a2h/a3h + a6h/a7h 0000h ffffh 128-byte data 256 bytes structure 0000h ffffh 256 bytes 0000h ffffh alr 256-byte data 256 bytes structure 128-byte data structure a0h/a1h a0h/a1h a2h/a3h ahr<7:1> alr 0 7 8 15 addr pointer 9 1 ahr<7:1> alr 0 7 8 15 addr pointer 9 0 512 ahr<7:1> * 256 ahr * ddc v2 + p&d mode: cf[1:0] bits = 10b ddc v2 / p&d / fpdi-2 modes: cf[1:0] bits != 10b extended edid v1 (if present) basic edid v1 extended edid v1 (if present) basic edid v1 edid v2 edid v2 alr : 80h -> ffh alr : 80h -> ffh alr : 00h -> 7fh alr : 00h -> 7fh
st72774/st727754/st72734 105/144 ddc interface (contd) n write operation once the ddc1/2b interface has acknowledged a write transfer request, i.e. a device address with rw=0, it waits for a data address. when the latter is received, it is acknowledged and loaded into the alr. then, the master may send any number of data bytes that are all acknowledged by the ddc1/2b interface. the data bytes are written in ram if the wp bit=0 in the dcr register, otherwise the ram location is not modified. in any case, all write operations are performed in ram and therefore do not delay ddc transfers, although concurrent software execution is halted for 2 cycles. after each byte is transferred, the internal address counter is automatically incremented. if the counter is pointing to the top of the structure, it rolls over to the bottom since the incrementation is performed only on the 7 or 8 lsbs of the pointer depending on the selected data structure size. in other words, alr rolls over from ffh to 00h for device addresses a2h/a3h and a6h/a7h. otherwise, it rolls over from 7fh to 00h or from ffh to 80h depending on the msb of the last data address received. then after that last byte has been effectively written in ram, the edf flag is set and an interrupt is generated if ede is set. the transfer is terminated by the master generating a stop condition. figure 65. write sequence n read operations all read operations consist of retrieving the data pointed to by an internal address counter which is initialized by a dummy write and incremented by any read. the ddc1/2b interface always waits for an acknowledge during the 9th bit-time. if the master does not pull the sda line low during this bit-time, the ddc1/2b interface ends the transfer and switches to a stand-by state. C current address read: after generating a start condition the master sends a read device address (rw = 1). the ddc1/2b interface ac- knowledges this and outputs the data byte point- ed to by the internal address pointer which is subsequently incremented. the master must not acknowledge this byte and must terminate the transfer with a stop condition. C random address read: the master performs a dummy write to load the data address into the alr. then the master sends a restart condi- tion followed by a read device address (rw=1). C sequential address read: this mode is similar to the current and random address reads, except that the master does acknowledge the data byte for the ddc1/2b interface to output the next byte in sequence. to terminate the read opera- tion the master must not acknowledge the last data byte and must generate a stop condition. the data output are from consecutive memory addresses. the internal address counter is incre- mented automatically after each byte. if the counter is pointing to the top of the structure, it rolls over to the bottom since the incrementation is performed only on the 7 or 8 lsbs of the counter depending on the selected data structure size. start r/w ack data addr. data in 1 data in 2 ack ack data in n ack stop ack dev addr sda xxxxh addr addr + n -1 addr. pointer addr + 1 addr + n
st72774/st727754/st72734 106/144 ddc interface (contd) figure 66. read sequences start r/w ack data out no ack stop dev addr sda addr addr + 1 addr. pointer start r/w ack data addr. ack dev addr sda xxxxh addr addr. pointer addr + 1 r/w ack data out no ack stop dev addr start r/w ack data out 1 dev addr sda addr addr. pointer data out 2 ack data out n ack stop no ack addr + n -1 addr + 1 addr + n current address read random address read sequential address read restart
st72774/st727754/st72734 107/144 ddc interface (contd) 4.8.5.2 ddc/ci - factory alignment interface 4.8.5.2.1 functional description refer to the cr, sr1 and sr2 registers in section 4.8.6 . for the bit definitions. the ddc/ci interface works as an i/o interface between the microcontroller and the ddc2bi, eddc or factory alignment protocols. it receives and transmits data in slave i 2 c mode using an interrupt or polled handshaking. the interface is connected to the i 2 c bus by a data pin (sdad) and a clock pin (scld) configured as open drain. the ddc/ci interface has five internal register locations. two of them are used for initialization of the interface: C own address register oar C control register cr the following four registers are used during data transmission/reception: C data register dr C control register cr C status register 1 sr1 C status register 2 sr2 the interface decodes an i 2 c or ddc2bi address stored by software in the oar register and/or the eddc address (60h/61h) as its default hardware address. after a reset, the interface is disabled. 4.8.5.2.2 i 2 c modes n general description in i 2 c mode, the interface can operate in the following modes: C slave transmitter/receiver both start and stop conditions are generated by the master. the i2c clock (scl) is always received by the interface from a master, but the interface is able to stretch the clock line. the interface is capable of recognizing both its own programmable address (7-bit) and its default hardware address (enhanced ddc address: 60h/ 61h). the enhanced ddc address detection may be enabled or disabled by software. it never recognizes the start byte (01h) whatever its own address is. n slave mode as soon as a start condition is detected, the address is received from the sda line and sent to the shift register; then it is compared with the programmable address of the interface or the enhanced ddc address (if selected by software). address not matched : the interface ignores it and waits for another start condition. address matched : the following events occur in sequence: C acknowledge pulse is generated if the ack bit is set. C evf and adsl bits are set. C an interrupt is generated if the ite bit is set. then the interface waits for a read of the sr1 register, holding the scl line low (see figure 67 transfer sequencing ev1). next, the dr register must be read to determine from the least significant bit if the slave must enter receiver or transmitter mode.
st72774/st727754/st72734 108/144 ddc interface (contd) slave receiver following the address reception and after sr1 register has been read, the slave receives bytes from the sda line into the dr register via the internal shift register. after each byte, the following events occur in sequence: C acknowledge pulse is generated if the ack bit is set. C evf and btf bits are set. C an interrupt is generated if the ite bit is set. then the interface waits for a read of the sr1 register followed by a read of the dr register, holding the scl line low (see figure 67 transfer sequencing ev2). slave transmitter following the address reception and after sr1 register has been read, the slave sends bytes from the dr register to the sda line via the internal shift register. the slave waits for a read of the sr1 register followed by a write in the dr register, holding the scl line low (see figure 67 transfer sequencing ev3). when the acknowledge pulse is received: C evf and btf bits are set. C an interrupt is generated if the ite bit is set. closing slave communication after the last data byte is transferred, a stop condition is generated by the master. the interface detects this condition and in this case: C evf and stopf bits are set. C an interrupt is generated if the ite bit is set. then the interface waits for a read of the sr2 register (see figure 67 transfer sequencing ev4). error cases C berr : detection of a stop or a start condition during a byte transfer. in this case, the evf and the berr bits are set and an interrupt is gener- ated if the ite bit is set. if it is a stop then the interface discards the data, releases the lines and waits for another start condition. if it is a start then the interface discards the data and waits for the next slave address on the bus. C af : detection of a non-acknowledge bit. in this case, the evf and af bits are set and an inter- rupt is generated if the ite bit is set. note: in both cases, scl line is not held low; however, sda line can remain low due to possible ?0? bits transmitted last. it is then necessary to release both lines by software. how to release the sda / scl lines set and subsequently clear the stop bit while btf is set. the sda/scl lines are released after the transfer of the current byte. other events n adsl : detection of a start condition after an acknowledge time-slot. the state machine is reset and starts a new process. the adsl bit is set and an interrupt is generated if the ite bit is set. the scl line is stretched low. n stopf : detection of a stop condition after an acknowledge time-slot. the state machine is reset. then the stopf flag is set and an interrupt is generated if the ite bit is set.
st72774/st727754/st72734 109/144 ddc interface (contd) figure 67. transfer sequencing legend: s=start, p=stop, a=acknowledge, na=non-acknowledge evx=event (with interrupt if ite=1) ev1: evf=1, adsl=1, cleared by reading sr1 register. ev2: evf=1, btf=1, cleared by reading sr1 register followed by reading dr register. ev3: evf=1, btf=1, cleared by reading sr1 register followed by writing dr register. ev4: evf=1, stopf=1, cleared by reading sr2 register. figure 68. event flags and interrupt generation sl ave rece i ver: slave transmitter: s address a data1 a data2 a ..... datan a p ev1 ev2 ev2 ev2 ev4 s address a data1 a data2 a ..... datan na p ev1 ev3 ev3 ev3 ev3 ev4 btf adsl af stopf berr evf interrupt ite
st72774/st727754/st72734 110/144 ddc interface (contd) 4.8.6 register description ddc control register (cr) read / write reset value: 0000 0000 (00h) bit 7:6 = reserved. forced to 0 by hardware. bit 5 = pe peripheral enable. this bit is set and cleared by software. 0: peripheral disabled 1: slave capability notes: C when pe=0, all the bits of the cr register and the sr register are reset. all outputs are re- leased while pe=0 C when pe=1, the corresponding i/o pins are se- lected by hardware as alternate functions. C to enable the i 2 c interface, write the cr register twice with pe=1 as the first write only activates the interface (only pe is set). bit 4 = eddcen enhanced ddc address detection enabled. this bit is set and cleared by software. it is also cleared by hardware when the interface is disabled (pe=0). the 60h/61h enhanced ddc address is acknowledged. 0: enhanced ddc address detection disabled 1: enhanced ddc address detection enabled bit 3 = reserved. forced to 0 by hardware. bit 2 = ack acknowledge enable. this bit is set and cleared by software. it is also cleared by hardware when the interface is disabled (pe=0). 0: no acknowledge returned 1: acknowledge returned after an address byte or a data byte is received bit 1 = stop release i2c bus . this bit is set and cleared by software or when the interface is disabled (pe=0). C slave mode: 0: nothing 1: release the scl and sda lines after the cur- rent byte transfer (btf=1). the stop bit has to be cleared by software. bit 0 = ite interrupt enable. this bit is set and cleared by software and cleared by hardware when the interface is disabled (pe=0). 0: interrupts disabled 1: interrupts enabled refer to figure 68 for the relationship between the events and the interrupt. scl is held low when the btf or adsl is detect- ed. 70 00pe eddc en 0ackstopite
st72774/st727754/st72734 111/144 ddc interface (contd) ddc status register 1 (sr1) read only reset value: 0000 0000 (00h) bit 7 = evf event flag. this bit is set by hardware as soon as an event occurs. it is cleared by software reading sr2 register in case of error event or as described in figure 67 . it is also cleared by hardware when the interface is disabled (pe=0). 0: no event 1: one of the following events has occurred: C btf=1 (byte received or transmitted) C adsl=1 (address matched in slave mode while ack=1) C af=1 (no acknowledge received after byte transmission if ack=1) C stopf=1 (stop condition detected in slave mode) C berr=1 (bus error, misplaced start or stop condition detected) bit 6 = reserved. forced to 0 by hardware. bit 5 = tra transmitter/receiver. when btf is set, tra=1 if a data byte has been transmitted. it is cleared automatically when btf is cleared. it is also cleared by hardware after detection of stop condition (stopf=1) or when the interface is disabled (pe=0). 0: data byte received (if btf=1) 1: data byte transmitted bit 4 = busy bus busy . this bit is set by hardware on detection of a start condition and cleared by hardware on detection of a stop condition. it indicates a communication in progress on the bus. this information is still updated when the interface is disabled (pe=0). 0: no communication on the bus 1: communication ongoing on the bus bit 3 = btf byte transfer finished. this bit is set by hardware as soon as a byte is correctly received or transmitted with interrupt generation if ite=1. it is cleared by software reading sr1 register followed by a read or write of dr register. it is also cleared by hardware when the interface is disabled (pe=0). C following a byte transmission, this bit is set after reception of the acknowledge clock pulse. . btf is cleared by reading sr1 register followed by writing the next byte in dr register. C following a byte reception, this bit is set after transmission of the acknowledge clock pulse if ack=1. btf is cleared by reading sr1 register followed by reading the byte from dr register. the scl line is held low while btf=1. 0: byte transfer not done 1: byte transfer succeeded bit 2 = adsl address matched (slave mode). this bit is set by hardware as soon as the received slave address matched with the oar register content or the enhanced ddc address is recognized. an interrupt is generated if ite=1. it is cleared by software reading sr1 register or by hardware when the interface is disabled (pe=0). the scl line is held low while adsl=1. 0: address mismatched or not received 1: received address matched bit 1:0 = reserved. forced to 0 by hardware. 70 evf 0 tra busy btf adsl 0 0
st72774/st727754/st72734 112/144 ddc interface (contd) ddc status register 2 (sr2) read only reset value: 0000 0000 (00h) bit 7:5 = reserved. forced to 0 by hardware. bit 4 = af acknowledge failure . this bit is set by hardware when no acknowledge is returned. an interrupt is generated if ite=1. it is cleared by software reading sr2 register or by hardware when the interface is disabled (pe=0). the scl line is not held low while af=1. 0: no acknowledge failure 1: acknowledge failure bit 3 = stopf stop detection. this bit is set by hardware when a stop condition is detected on the bus after an acknowledge (if ack=1). an interrupt is generated if ite=1. it is cleared by software reading sr2 register or by hardware when the interface is disabled (pe=0). the scl line is not held low while stopf=1. 0: no stop condition detected 1: stop condition detected bit 2 = reserved. forced to 0 by hardware. bit 1 = berr bus error. this bit is set by hardware when the interface detects a misplaced start or stop condition. an interrupt is generated if ite=1. it is cleared by software reading sr2 register or by hardware when the interface is disabled (pe=0). the scl line is not held low while berr=1. 0: no misplaced start or stop condition 1: misplaced start or stop condition bit 0 = eddcf enhanced ddc address detected. this bit is set by hardware when the enhanced ddc address (60h/61h) is detected on the bus while eddcen=1. it is cleared by hardware when a start or a stop condition (stopf=1) is detected, or when the interface is disabled (pe=0). 0: no enhanced ddc address detected on bus 1: enhanced ddc address detected on bus 70 0 0 0 af stopf 0 berr eddc f
st72774/st727754/st72734 113/144 ddc interface (contd) ddc data register ( dr) read / write reset value: 0000 0000 (00h) bit 7:0 = d7-d0 8-bit data register. these bits contain the byte to be received or transmitted on the bus. C transmitter mode: byte transmission start auto- matically when the software writes in the dr reg- ister. C receiver mode: the first data byte is received au- tomatically in the dr register using the least sig- nificant bit of the address. then, the next data bytes are received one by one after reading the dr register. ddc own address register (oar) read / write reset value: 0000 0000 (00h) bit 7:1 = add7-add1 interface address . these bits define the i 2 c bus programmable address of the interface. they are not cleared when the interface is disabled (pe=0). bit 0 = add0 . this bit is dont care, the interface acknowledges either 0 or 1. it is not cleared when the interface is disabled (pe=0). note: address 01h is always ignored. 70 d7 d6 d5 d4 d3 d2 d1 d0 70 add7 add6 add5 add4 add3 add2 add1 add0
st72774/st727754/st72734 114/144 ddc interface (contd) ddc1/2b control register (dcr) read / write reset value: 0000 0000 (00h) bit 7 = reserved. forced by hardware to 0. bit 5 = edf end of download interrupt flag . this bit is set by hardware and cleared by software. 0: download not started or not completed yet. 1: download completed. last byte of data struc- ture (relative address 7fh or ffh) has been stored in ram. bit 4 = ede end of download interrupt enable . this bit is set and cleared by software. 0: interrupt disabled. 1: a ddc1/2b interrupt is generated if edf bit is set. bits 6, 3:2 = cf[2:0] configuration bits. these bits are set and cleared by software only when the peripheral is disabled (hwpe = 0). they define which edid structure version is used and which device addresses are recognized as shown in the following table: bit 1 = wp write protect . this bit is set and cleared by software. 0: enable writes to the ram. 1: disable dma write transfers and protect the ram content. cpu writes to the ram are not affected. bit 0= hwpe peripheral enable . this bit is set and cleared by software. 0: release the sda port pin and ignore vsync and scl port pins. the other bits of the dcr and the content of the ahr are left un- changed. 1: enable the ddc interface and respond to the ddc1/ddc2b protocol. address pointer high register (ahr) read / write reset value: see register map ahr contains the 8 msbs of the 16-bit address pointer. it therefore defines the location of the 256- byte block containing the data structure within the cpu address space. note: ahr0 is ignored when cf[1:0] = 10 (p&d+ v2 mode) to allow non-overlapping 128-byte and 256- byte data structures. 70 0 cf2 edf ede cf1 cf0 wp hwpe 70 msb lsb cf[2:0] bit values edid version used ddc1 mode support / transition mode support ddc2b addresses recognized 000 ddc v2 yes (128b edid) / yes 128b-edid @a0h/a1h 001 p&d no 256b-edid @ a2h/a3h 010 v2 + p&d yes (128b edid) / yes 128b-edid @a0h/a1h 256b-edid @ a2h/a3h 011 fpdi-2 no 256b-edid @ a6h/a7h 100 ddc v2 no 128b-edid @a0h/a1h 101 reserved d sd 110 v2 + p&d no 128b-edid @a0h/a1h 256b-edid @ a2h/a3h 111 reserved d sd
st72774/st727754/st72734 115/144 ddc interface (contd) table 26. ddc register map and reset values address (hex.) register name 765 4 3210 50 cr reset value 0 0 pe 0 eddcen 00 ack 0 stop 0 ite 0 51 sr1 reset value evf 00 tra 0 busy 0 btf 0 adsl 000 52 sr2 reset value 0 0 0 af 0 stopf 00 berr 0 eddcf 0 54 oar reset value add7 0 add6 0 add5 0 add4 0 add3 0 add2 0 add1 0 add0 0 56 dr reset value d7 0 d6 0 d5 0 d4 0 d3 0 d2 0 d1 0 d0 0 0c dcr reset value 0 cf2 0 edf 0 ede 0 cf1 0 cf0 0 wp 0 hwpe 0 0d ahr reset value ahr7 0 ahr6 0 ahr5 0 ahr4 0 ahr3 0 ahr2 0 ahr1 0 ahr0 0
st72774/st727754/st72734 116/144 4.9 pwm/brm generator (dac) 4.9.1 introduction this pwm/brm peripheral includes two types of pwm/brm outputs, with differing step resolutions based on the pulse width modulator (pwm) and binary rate multiplier (brm) generator technique are available. it allows the digital to analog conversion (dac) when used with external filtering. 4.9.2 main features n fixed frequency: f cpu /64 n resolution: t cpu n 10-bit pwm/brm generator with a step of v dd /2 10 (5mv if v dd =5v) 4.9.3 functional description 4.9.3.1 pwm/brm the 10 bits of the 10-bit pwm/brm are distributed as 6 pwm bits and 4 brm bits. the generator consists of a 12-bit counter (common for all channels), a comparator and the pwm/brm generation logic. pwm generation the counter increments continuously, clocked at internal cpu clock. whenever the 6 least significant bits of the counter (defined as the pwm counter) overflow, the output level for all active channels is set. the state of the pwm counter is continuously compared to the pwm binary weight for each channel, as defined in the relevant pwm register, and when a match occurs the output level for that channel is reset. this pulse width modulated signal must be filtered, using an external rc network placed as close as possible to the associated pin. this provides an analog voltage proportional to the average charge passed to the external capacitor. thus for a higher mark/space ratio (high time much greater than low time) the average output voltage is higher. the external components of the rc network should be selected for the filtering level required for control of the system variable. each output may individually have its polarity inverted by software, and can also be used as a logical output. figure 69. pwm generation counter 63 compare value overflow overflow overflow 000 t pwm output t t cpu x 64
st72774/st727754/st72734 117/144 pwm/brm outputs (contd) pwm/brm outputs the pwm/brm outputs are assigned to dedicated pins. the rc filter time must be higher than tcpux64. figure 70 . typical pwm output filter table 27 . 6-bit pwm ripple after filtering with rc filter (r=1k w ), f cpu = 8 mhz v dd = 5v pwm duty cycle 50% r=rext. figure 71. pwm simplified voltage output after filtering c ext output voltage stage output r ext c ext (f) v ripple (mv) 0.128 78 1.28 7.8 12.8 0.78 v dd 0v 0v dd v v ripple (mv) v outavg "charge" "discharge" "charge" "discharge" 0v v v 0v outavg v (mv) ripple v vr01956 "charge" "discharge" "charge" "discharge" pwmout dd dd pwmout output voltage output voltage
st72774/st727754/st72734 118/144 pwm/brm generator (contd) brm generation the brm bits allow the addition of a pulse to widen a standard pwm pulse for specific pwm cycles. this has the effect of fine-tuning the pwm duty cycle (without modifying the base duty cycle), thus, with the external filtering, providing additional fine voltage steps. the incremental pulses (with duration of t cpu ) are added to the beginning of the original pwm pulse. the pwm intervals which are added to are specified in the 4-bit brm register and are encoded as shown in the following table. the brm values shown may be combined together to provide a summation of the incremental pulse intervals specified. the pulse increment corresponds to the pwm resolution. for example,if C data 18h is written to the pwm register C data 06h (00000110b) is written to the brm reg- ister C with a 8mhz internal clock (125ns resolution) then 3.0 m s-long pulse will be output at 8 m s intervals, except for cycles numbered 2,4,6,10,12,14, where the pulse is broadened to 3.125 m s. note: if 00h is written to both pwm and brm registers, the generator output will remain at 0. conversely, if both registers hold data 3fh and 0fh, respective- ly, the output will remain at 1 for all intervals #1 to #15, but it will return to zero at interval #0 for an amount of time corresponding to the pwm resolu- tion (t cpu ). an output can be set to a continuous 1 level by clearing the pwm and brm values and setting pol = 1 (inverted polarity) in the pwm register. this allows a pwm/brm channel to be used as an additional i/o pin if the dac function is not required. table 28. bit brm added pulse intervals (interval #0 not selected). figure 72. brm pulse addition (pwm > 0) brm 4 - bit data incremental pulse intervals 0000 none 0001 i = 8 0010 i = 4,12 0100 i = 2,6,10,14 1000 i = 1,3,5,7,9,11,13,15 t cpu x 64 t cpu x 64 t cpu x 64 t cpu x 64 increment m = 1 m = 0 m = 2 t cpu x 64 m = 15
st72774/st727754/st72734 119/144 pwm/brm generator (contd) figure 73. simplified filtered voltage output schematic with brm added figure 74. graphical representation of 4-bit brm added pulse positions vdd pwmout 0v vdd output voltage 0v brm = 1 brm = 0 t cpu brm extended pulse = = 0100 bit2=1 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 pwm pulse number (0-15) brm value 0001 bit0=1 0001 bit0=1 0100 bit2=1 examples 0110 1111
st72774/st727754/st72734 120/144 pwm/brm generator (contd) 4.9.3.2 pwm/brm outputs the pwm/brm outputs are assigned to dedicated pins. if necessary, these pins can be used in push-pull or open-drain modes under software control. in these pins, the pwm/brm outputs are connected to a serial resistor which must be taken into account to calculate the rc filter. figure 75. precision for pwm/brm tuning for vouteff (after filtering) v dd steps 64 63 60 61 62 0f v dd 64 each sub steps of v dd 1024 each 16 sub steps of each v dd 4096 1234 1 5 10 15 10 1 20 40 50 63 64 6 - bit pwm 4 - bit brm or 6 - bit brm 0
st72774/st727754/st72734 121/144 pwm/brm generator (contd) 4.9.4 register description 4.9.4.1 pwm/brm registers on a channel basis, the 10 bits are separated into two data registers: C a 6-bit pwm register corresponding to the binary weight of the pwm pulse. C a 4-bit brm register defining the intervals where an incremental pulse is added to the beginning of the original pwm pulse. two brm channel val- ues share the same register. note: the number of pwm and brm channels available depends on the device. refer to the device pin de- scription and register map. pwm[1:8] registers read/write reset value 1000 0000 (80h) bit 7 = reserved (read as 1) bit 6 = pol polarity bit. when pol is set, output signal polarity is inverse; otherwise, no change occurs. bits 5:0 = p[5:0] pwm pulse binary weight for channel i . brm registers brm21 (channels 2 + 1) brm43 (channels 4 + 3) brm65 (channels 6 + 5) brm87 (channels 8 + 7) read/write reset value: 0000 0000 (00h) bits 7:4 = b[7:4] brm bits (channel i+1) bits 3:0 = b[3:0] brm bits (channel i) 4.9.4.2 output enable register read/write reset value 1000 0000 (80h) bit 7:0 = oe[7:0] output enable bit. when oei is set, pwm output function is enabled. 0: pwm output is disabled 1: pwm output is enabled note: from the programmer's point of view, the pwm and brm registers can be regarded as being combined to give one data value. for example (10-bit) effective (with external rc filtering) dac value 70 1 pol p5 p4 p3 p2 p1 p0 70 b7 b6 b5 b4 b3 b2 b1 b0 70 oe7 oe6 oe5 oe4 oe3 oe2 oe1 oe0 0polpppppp+bbbb 0polppppppbbbb
st72774/st727754/st72734 122/144 table 29. pwm register map address (hex.) register name 765 4 3210 32 pwm1 pol p5 ..p0 33 brm21 brm channel 2 brm channel 1 34 pwm2 pol p5 ..p0 35 pwm3 pol p5 ..p0 36 brm43 brm channel 4 brm channel 3 37 pwm4 pol p5 ..p0 38 pwm5 pol p5 ..p0 39 brm65 brm channel 6 brm channel 5 3a pwm6 pol p5 ..p0 3b pwm7 pol p5 ..p0 3c brm87 brm channel 8 brm channel 7 3d pwm8 pol p5 ..p0 3e pwmcr oe7 ..oe0
st72774/st727754/st72734 123/144 4.10 8-bit a/d converter (adc) 4.10.1 introduction the on-chip analog to digital converter (adc) peripheral is a 8-bit, successive approximation converter with internal sample and hold circuitry. this peripheral has up to 16 multiplexed analog input channels (refer to device pin out description) that allow the peripheral to convert the analog voltage levels from up to 16 different sources. the result of the conversion is stored in a 8-bit data register. the a/d converter is controlled through a control/status register. 4.10.2 main features n 8-bit conversion n up to 16 channels with multiplexed input n linear successive approximation n data register (dr) which contains the results n conversion complete status flag n on/off bit (to reduce consumption) the block diagram is shown in figure 76 . 4.10.3 functional description 4.10.3.1 analog power supply v dda and v ssa are the high and low level reference voltage pins. in some devices (refer to device pin out description) they are internally connected to the v dd and v ss pins. conversion accuracy may therefore be impacted by voltage drops and noise in the event of heavily loaded or badly decoupled power supply lines. see electrical characteristics section for more details. figure 76. adc block diagram ch2 ch1 ch3 coco 0 adon 0 ch0 adccsr ain0 ain1 analog to digital converter ainx analog mux r adc c adc d2 d1 d3 d7 d6 d5 d4 d0 adcdr 4 div 4 f adc f cpu hold control
st72774/st727754/st72734 124/144 4.10.3.2 digital a/d conversion result the conversion is monotonic, meaning that the result never decreases if the analog input does not and never increases if the analog input does not. if the input voltage (v ain ) is greater than or equal to v dda (high-level voltage reference) then the conversion result in the dr register is ffh (full scale) without overflow indication. if input voltage (v ain ) is lower than or equal to v ssa (low-level voltage reference) then the conversion result in the dr register is 00h. the a/d converter is linear and the digital result of the conversion is stored in the adcdr register. the accuracy of the conversion is described in the parametric section. r ain is the maximum recommended impedance for an analog input signal. if the impedance is too high, this will result in a loss of accuracy due to leakage and sampling not being completed in the alloted time. 4.10.3.3 a/d conversion phases the a/d conversion is based on two conversion phases as shown in figure 77 : n sample capacitor loading [duration: t load ] during this phase, the v ain input voltage to be measured is loaded into the c adc sample capacitor. n a/d conversion [duration: t conv ] during this phase, the a/d conversion is computed (8 successive approximations cycles) and the c adc sample capacitor is disconnected from the analog input pin to get the optimum analog to digital conversion accuracy. while the adc is on, these two phases are continuously repeated. at the end of each conversion, the sample capacitor is kept loaded with the previous measurement load. the advantage of this behaviour is that it minimizes the current consumption on the analog pin in case of single input channel measurement. 4.10.3.4 software procedure refer to the control/status register (csr) and data register (dr) in section 4.10.6 for the bit definitions and to figure 77 for the timings. adc configuration the total duration of the a/d conversion is 12 adc clock periods (1/f adc =4/f cpu ). the analog input ports must be configured as input, no pull-up, no interrupt. refer to the ?i/o ports? chapter. using these pins as analog inputs does not affect the ability of the port to be read as a logic input. in the csr register: C select the ch[3:0] bits to assign the analog channel to be converted. adc conversion in the csr register: C set the adon bit to enable the a/d converter and to start the first conversion. from this time on, the adc performs a continuous conver- sion of the selected channel. when a conversion is complete C the coco bit is set by hardware. C no interrupt is generated. C the result is in the dr register and remains valid until the next conversion has ended. a write to the csr register (with adon set) aborts the current conversion, resets the coco bit and starts a new conversion. figure 77. adc conversion timings 4.10.4 low power mode note: the a/d converter is disabled by resetting the adon bit. with this feature, power consumption is reduced when no conversion is needed and be- tween single shot conversions. 4.10.5 interrupts none mode description wait no effect on a/d converter adccsr write adon coco bit set t load t conv operation hold control
st72774/st727754/st72734 125/144 8-bit a/d converter (adc) (contd) 4.10.6 register description control/status register (csr) read/write reset value: 0000 0000 (00h) bit 7 = coco conversion complete this bit is set by hardware. it is cleared by software reading the result in the dr register or writing to the csr register. 0: conversion is not complete 1: conversion can be read from the dr register bit 6 = reserved. must always be cleared. bit 5 = adon a/d converter on this bit is set and cleared by software. 0: a/d converter is switched off 1: a/d converter is switched on bit 4 = reserved. must always be cleared. bit 3:0 = ch[3:0] channel selection these bits are set and cleared by software. they select the analog input to convert. note: the number of pins and the channel selection var- ies according to the device. refer to the device pinout. data register (dr) read only reset value: 0000 0000 (00h) bit 7:0 = d[7:0] analog converted value this register contains the converted analog value in the range 00h to ffh. note: reading this register reset the coco flag. table 30. adc register map 70 coco 0 adon 0 ch3 ch2 ch1 ch0 channel pin* ch3 ch2 ch1 ch0 ain0 0 0 0 0 ain1 0 0 0 1 ain2 0 0 1 0 ain3 0 0 1 1 ain4 0 1 0 0 ain5 0 1 0 1 ain6 0 1 1 0 ain7 0 1 1 1 ain8 1 0 0 0 ain9 1 0 0 1 ain10 1 0 1 0 ain11 1 0 1 1 ain12 1 1 0 0 ain13 1 1 0 1 ain14 1 1 1 0 ain15 1 1 1 1 70 d7 d6 d5 d4 d3 d2 d1 d0 address (hex.) register name 765 4 3210 0a adcdr reset value d7 0 d6 0 d5 0 d4 0 d3 0 d2 0 d1 0 d0 0 0b adccsr reset value coco 0 - 0 adon 0 - 0 ch3 0 ch2 0 ch1 0 ch0 0
st72774/st727754/st72734 126/144 5 instruction set 5.1 st7 addressing modes the st7 core features 17 different addressing modes which can be classified in 7 main groups: the st7 instruction set is designed to minimize the number of bytes required per instruction: to do so, most of the addressing modes may be subdivided in two sub-modes called long and short: C long addressing mode is more powerful be- cause it can use the full 64 kbyte address space, however it uses more bytes and more cpu cy- cles. C short addressing mode is less powerful because it can generally only access page zero (0000h - 00ffh range), but the instruction size is more compact, and faster. all memory to memory in- structions use short addressing modes only (clr, cpl, neg, bset, bres, btjt, btjf, inc, dec, rlc, rrc, sll, srl, sra, swap) the st7 assembler optimizes the use of long and short addressing modes. table 31. st7 addressing mode overview note 1. at the time the instruction is executed, the program counter (pc) points to the instruction following jrxx. addressing mode example inherent nop immediate ld a,#$55 direct ld a,$55 indexed ld a,($55,x) indirect ld a,([$55],x) relative jrne loop bit operation bset byte,#5 mode syntax destination/ source pointer address (hex.) pointer size (hex.) length (bytes) inherent nop + 0 immediate ld a,#$55 + 1 short direct ld a,$10 00..ff + 1 long direct ld a,$1000 0000..ffff + 2 no offset direct indexed ld a,(x) 00..ff + 0 (with x register) + 1 (with y register) short direct indexed ld a,($10,x) 00..1fe + 1 long direct indexed ld a,($1000,x) 0000..ffff + 2 short indirect ld a,[$10] 00..ff 00..ff byte + 2 long indirect ld a,[$10.w] 0000..ffff 00..ff word + 2 short indirect indexed ld a,([$10],x) 00..1fe 00..ff byte + 2 long indirect indexed ld a,([$10.w],x) 0000..ffff 00..ff word + 2 relative direct jrne loop pc-128/pc+127 1) + 1 relative indirect jrne [$10] pc-128/pc+127 1) 00..ff byte + 2 bit direct bset $10,#7 00..ff + 1 bit indirect bset [$10],#7 00..ff 00..ff byte + 2 bit direct relative btjt $10,#7,skip 00..ff + 2 bit indirect relative btjt [$10],#7,skip 00..ff 00..ff byte + 3 6
st72774/st727754/st72734 127/144 st7 addressing modes (contd) 5.1.1 inherent all inherent instructions consist of a single byte. the opcode fully specifies all the required information for the cpu to process the operation. 5.1.2 immediate immediate instructions have two bytes, the first byte contains the opcode, the second byte contains the operand value. 5.1.3 direct in direct instructions, the operands are referenced by their memory address. the direct addressing mode consists of two sub- modes: direct (short) the address is a byte, thus requires only one byte after the opcode, but only allows 00 - ff addressing space. direct (long) the address is a word, thus allowing 64 kbyte addressing space, but requires 2 bytes after the opcode. 5.1.4 indexed (no offset, short, long) in this mode, the operand is referenced by its memory address, which is defined by the unsigned addition of an index register (x or y) with an offset. the indirect addressing mode consists of three sub-modes: indexed (no offset) there is no offset, (no extra byte after the opcode), and allows 00 - ff addressing space. indexed (short) the offset is a byte, thus requires only one byte after the opcode and allows 00 - 1fe addressing space. indexed (long) the offset is a word, thus allowing 64 kbyte addressing space and requires 2 bytes after the opcode. 5.1.5 indirect (short, long) the required data byte to do the operation is found by its memory address, located in memory (pointer). the pointer address follows the opcode. the indirect addressing mode consists of two sub- modes: indirect (short) the pointer address is a byte, the pointer size is a byte, thus allowing 00 - ff addressing space, and requires 1 byte after the opcode. indirect (long) inherent instruction function nop no operation trap s/w interrupt wfi wait for interrupt (low power mode) halt disabled, forces a reset ret sub-routine return iret interrupt sub-routine return sim set interrupt mask rim reset interrupt mask scf set carry flag rcf reset carry flag rsp reset stack pointer ld load clr clear push/pop push/pop to/from the stack inc/dec increment/decrement tnz test negative or zero cpl, neg 1 or 2 complement mul byte multiplication sll, srl, sra, rlc, rrc shift and rotate operations swap swap nibbles immediate instruction function ld load cp compare bcp bit compare and, or, xor logical operations adc, add, sub, sbc arithmetic operations
st72774/st727754/st72734 128/144 the pointer address is a byte, the pointer size is a word, thus allowing 64 kbyte addressing space, and requires 1 byte after the opcode. 5.1.6 indirect indexed (short, long) this is a combination of indirect and short indexed addressing modes. the operand is referenced by its memory address, which is defined by the unsigned addition of an index register value (x or y) with a pointer value located in memory. the pointer address follows the opcode. the indirect indexed addressing mode consists of two sub-modes: indirect indexed (short) the pointer address is a byte, the pointer size is a byte, thus allowing 00 - 1fe addressing space, and requires 1 byte after the opcode. indirect indexed (long) the pointer address is a byte, the pointer size is a word, thus allowing 64 kbyte addressing space, and requires 1 byte after the opcode. table 32. instructions supporting direct, indexed, indirect and indirect indexed addressing modes 5.1.7 relative mode (direct, indirect) this addressing mode is used to modify the pc register value, by adding an 8-bit signed offset to it. the relative addressing mode consists of two sub- modes: relative (direct) the offset follows the opcode. relative (indirect) the offset is defined in memory, of which the ad- dress follows the opcode. long and short instructions function ld load cp compare and, or, xor logical operations adc, add, sub, sbc arithmetic addition/subtrac- tion operations bcp bit compare short instructions only function clr clear inc, dec increment/decrement tnz test negative or zero cpl, neg 1 or 2 complement bset, bres bit operations btjt, btjf bit test and jump opera- tions sll, srl, sra, rlc, rrc shift and rotate operations swap swap nibbles call, jp call or jump subroutine available relative direct/ indirect instructions function jrxx conditional jump callr call relative
st72774/st727754/st72734 129/144 5.2 instruction groups the st7 family devices use an instruction set consisting of 63 instructions. the instructions may be subdivided into 13 main groups as illustrated in the following table: using a pre-byte the instructions are described with one to four bytes. in order to extend the number of available opcodes for an 8-bit cpu (256 opcodes), three different prebyte opcodes are defined. these prebytes modify the meaning of the instruction they precede. the whole instruction becomes: pc-2 end of previous instruction pc-1 prebyte pc opcode pc+1 additional word (0 to 2) according to the number of bytes required to compute the ef- fective address these prebytes enable instruction in y as well as indirect addressing modes to be implemented. they precede the opcode of the instruction in x or the instruction using direct addressing mode. the prebytes are: pdy 90 replace an x based instruction using immediate, direct, indexed, or inherent ad- dressing mode by a y one. pix 92 replace an instruction using di- rect, direct bit, or direct relative addressing mode to an instruction using the corresponding indirect addressing mode. it also changes an instruction using x indexed ad- dressing mode to an instruction using indirect x in- dexed addressing mode. piy 91 replace an instruction using x in- direct indexed addressing mode by a y one. load and transfer ld clr stack operation push pop rsp increment/decrement inc dec compare and tests cp tnz bcp logical operations and or xor cpl neg bit operation bset bres conditional bit test and branch btjt btjf arithmetic operations adc add sub sbc mul shift and rotates sll srl sra rlc rrc swap sla unconditional jump or call jra jrt jrf jp call callr nop ret conditional branch jrxx interruption management trap wfi iret code condition flag modification sim rim scf rcf
st72774/st727754/st72734 130/144 instruction groups (contd) mnemo description function/example dst src h i n z c adc add with carry a = a + m + c a m h n z c add addition a = a + m a m h n z c and logical and a = a . m a m n z bcp bit compare a, memory tst (a . m) a m n z bres bit reset bres byte, #3 m bset bit set bset byte, #3 m btjf jump if bit is false (0) btjf byte, #3, jmp1 m c btjt jump if bit is true (1) btjt byte, #3, jmp1 m c call call subroutine callr call subroutine relative clr clear reg, m 0 1 cp arithmetic compare tst(reg - m) reg m n z c cpl one complement a = ffh-a reg, m n z 1 dec decrement dec y reg, m n z iret interrupt routine return pop cc, a, x, pc h i n z c inc increment inc x reg, m n z jp absolute jump jp [tbl.w] jra jump relative always jrt jump relative jrf never jump jrf * jrih jump if ext. interrupt = 1 jril jump if ext. interrupt = 0 jrh jump if h = 1 h = 1 ? jrnh jump if h = 0 h = 0 ? jrm jump if i = 1 i = 1 ? jrnm jump if i = 0 i = 0 ? jrmi jump if n = 1 (minus) n = 1 ? jrpl jump if n = 0 (plus) n = 0 ? jreq jump if z = 1 (equal) z = 1 ? jrne jump if z = 0 (not equal) z = 0 ? jrc jump if c = 1 c = 1 ? jrnc jump if c = 0 c = 0 ? jrult jump if c = 1 unsigned < jruge jump if c = 0 jmp if unsigned >= jrugt jump if (c + z = 0) unsigned >
st72774/st727754/st72734 131/144 instruction groups (contd) mnemo description function/example dst src h i n z c jrule jump if (c + z = 1) unsigned <= ld load dst <= src reg, m m, reg n z mul multiply x,a = x * a a, x, y x, y, a 0 0 neg negate (2's compl) neg $10 reg, m n z c nop no operation or or operation a = a + m a m n z pop pop from the stack pop reg reg m pop cc cc m h i n z c push push onto the stack push y m reg, cc rcf reset carry flag c = 0 0 ret subroutine return rim enable interrupts i = 0 0 rlc rotate left true c c <= dst <= c reg, m n z c rrc rotate right true c c => dst => c reg, m n z c rsp reset stack pointer s = max allowed sbc subtract with carry a = a - m - c a m n z c scf set carry flag c = 1 1 sim disable interrupts i = 1 1 sla shift left arithmetic c <= dst <= 0 reg, m n z c sll shift left logic c <= dst <= 0 reg, m n z c srl shift right logic 0 => dst => c reg, m 0 z c sra shift right arithmetic dst7 => dst => c reg, m n z c sub subtraction a = a - m a m n z c swap swap nibbles dst[7..4] <=> dst[3..0] reg, m n z tnz test for neg & zero tnz lbl1 n z trap s/w trap s/w interrupt 1 wfi wait for interrupt 0 xor exclusive or a = a xor m a m n z
st72774/st727754/st72734 132/144 6 electrical characteristics the st727x4 device contains circuitry to protect the inputs against damage due to high static voltage or electric field. nevertheless it is advised to take normal precautions and to avoid applying to this high impedance voltage circuit any voltage higher than the maximum rated voltages. it is recommended for proper operation that v in and v out be constrained to the range: v ss ( v in or v out ) v dd to enhance reliability of operation, it is recommended to connect unused inputs to an appropriate logic voltage level such as v ss or v dd . all the voltages in the following table, are referenced to v ss . table 33 . absolute maximum ratings symbol ratings value unit v dd recommended supply voltage -0.3 to +6.0 v v in input voltage v ss -0.3 to v dd + 0.3 v v ain analog input voltage (a/d converter) v ss -0.3 to v dd + 0.3 v v out output voltage v ss -0.3 to v dd + 0.3 v i in input current -10......+10 ma i out output current -10......+10 ma i inj accumulated injected current of all i/o pins (v dd , v ss ) 40 ma t a operating temperature range 0 to +70 c t stg storage temperature range -65 to +150 c t j junction temperature 150 c pd power dissipation tbd mw esd esd susceptibility 2000 v 7
st72774/st727754/st72734 133/144 6.1 power considerations the average chip-junction temperature, t j , in degrees celsius, may be calculated using the following equation: t j = t a + (p d x q j a ) (1) where: C t a is the ambient temperature in c, C q j a is the package junction-to-ambient thermal resistance, in c/w, C p d is the sum of p int and p i/o , C p int is the product of i dd and v dd , expressed in watts. this is the chip internal power C p i/o represents the power dissipation on input and output pins; user determined. for most applications p i/o

st72774/st727754/st72734 134/144 6.2 ac/dc electrical characteristics (t a = 0 to +70c unless otherwise specified) note 1: halt mode no longer exists. note 2: the usb cell must be put in suspend mode as well as the mcu in halt mode. since the latter no longer exists for enhanced arcing protection, the measurement of the usb suspend consumption parameter is no longer relevant. note: : the minimum period t ilil should not be less than the number of cycle times it takes to execute the interrupt service routine plus 21 cycles. general symbol parameter conditions min typ. max unit v dd operating supply voltage run & wait mode 4.0 5 5.5 v i dd cpu run mode i/o in input mode v dd = 5v f cpu = 8 mhz, t a = 20 c 14 18 ma cpu wait mode 12 18 ma cpu halt mode (see note 1) n/a usb suspend mode (see note 2) n/a control timing symbol parameter conditions value unit min typ. max f osc f cpu frequency of operation: external frequency internal frequency internal frequency f osc = 24mhz f osc =12mhz 24 8 4 mhz t bu startup time built-up time crystal resonator 8 20 ms t rl external reset input pulse width 1000 ns t porl internal power reset duration 4096 t cpu t powl watchdog reset output pulse width 500 ns t dog watchdog time-out f cpu = 8 mhz 49152 6 3145728 384 t cpu ms t ilil interrupt pulse period (1) t cpu t oxov crystal oscillator start-up time 50 ms t ddr power up rise time v dd min 1 100 ms
st72774/st727754/st72734 135/144 ac/dc electrical characteristics (contd) note: note: all voltages are referred to v ss unless otherwise specified. standard i/o port pins symbol parameter conditions min typ max unit v ol output low level voltage port a[7,2:0], port b[7:4], port c[7:0], port d[6:0] push pull i ol = -1.6ma v dd =5v - - 0.4 v v ol output low level voltage port a[6:3] open drain i ol = -1.6ma v dd =5v - - 0.4 v v ol output low level voltage port a and port c i ol = -10ma v dd =5v - - 1.5 v v ol output low level voltage port b[3:0] open drain i ol = -3ma v dd =5v - - 0.4 v v oh output high level voltage port a[7, 2:0], port b[7:4], port c [7:0], port d [6:0] push pull i oh = 1.6ma v dd -0.8 - - v v ih input high level voltage port a [7:0], port b [7:0], port c [7:0], port d[6:0], reset leading edge 0.7xv dd v dd v v ih hsync,vsynci, csynci, hfback, vfback v dd = 5v 2.0 v v il hsync,vsynci, csynci, hfback, vfback v dd = 5v 0.8 v v il input low voltage port a [7:0], port b[7:0], port c[7:0], port d [6:0], reset trailing edge v ss 0.3xv dd v i il i/o ports hi-z leakage current port a [7:0], port b[7:0], port c[7:0], port d [6:0], reset 10 a c out c in capacitance: ports (as input or output), reset 12 8 pf pf irpu pull-up resistor current v dd =5v v in =v ss t=25c 280 a power on/off electrical specifications symbol parameter conditions min typ max unit v trh power on/off reset trigger v dd rising edge v dd variation 50mv/ms 3.35 3.65 3.9 v v trl power on/off reset trigger v dd falling edge v dd variation 50mv/ms 3.1 3.4 3.7 v v trm v dd minimum for power on/off reset active v dd variation 50mv/ms 2.0 2.2 v v trhyst power on/off lvd hysteresis v dd variation 50mv/ms 250 mv
st72774/st727754/st72734 136/144 ac/dc electrical characteristics (contd) 8-bit a/d converter symbol parameter conditions min typ max unit f adc analog control frequency v dd =5v 2 mhz |tue| total unadjusted error f cpu =8mhz, f adc =2mhz v dd =5v 2 lsb oe offset error -1 1 ge gain error -1 1 |dle| differential linearity error 0.5 |ile| integral linearity error 0.5 v ain conversion range voltage v ss v dd v i adc a/d conversion supply current f cpu =8mhz, f adc =2mhz v dd =5v 1ma t stab stabilization time after enable adc 1 s t load sample capacitor loading time 1 4 s 1/f adc t conv conversion time 2 8 s 1/f adc r ain external input resistor 15 k w r adc internal input resistor 1.5 k w c sample sample capacitor 6 pf pwm/brm electrical and timings symbol parameter conditions min typ max unit f repetition rate t cpu =125ns 125 khz res resolution t cpu =125ns 125 ns s output step v dd =5v, 10 bits 5 mv
st72774/st727754/st72734 137/144 ac/dc electrical characteristics (cont d) 1)the device must internally provide a hold time of at least 300 ns for the sda signal in order to bridge the undefined region of the falling edge of scl 2)the maximum hold time of the start condition has only to be met if the interface does not stretch the low period of scl signal cb = total capacitance of one bus line in pf i2c/ddc-bus electrical specifications parameter symbol unit standard mode i2c fast mode i2c minmaxminmax hysteresis of schmitt trigger inputs fixed input levels v dd -related input levels v hys vna na na na 0.2 0,05 v dd pulse width of spikes which must be sup- pressed by the input filter t sp ns na na 0 ns 50 ns output fall time from vih min to vil max with a bus capacitance from 10 pf to 400 pf with up to 3 ma sink current at vol1 with up to 6 ma sink current at vol2 t of ns na 250 na 20+0.1c b 20+0.1c b 250 250 input current each i/o pin with an input voltage between 0.4v and 0.9 v dd max i m a - 10 10 -10 10 capacitance for each i/o pin c pf 10 10 na = not applicable cb = capacitance of one bus in pf i2c/ddc-bus timings parameter standard i2c fast i2c symbol unit min max min max bus free time between a stop and start con- dition 4.7 1.3 t buf ms hold time start condition. after this period, the first clock pulse is generated 4.0 0.6 t hd:sta m s low period of the scl clock 4.7 1.3 t low m s high period of the scl clock 4.0 0.6 t high m s set-up time for a repeated start condition 4.7 0.6 t su:sta m s data hold time 0 (1) 0 (1) 0.9(2) t hd:dat ns data set-up time 250 100 t su:dat ns rise time of both sda and scl signals 1000 20+0.1cb 300 t r ns fall time of both sda and scl signals 300 20+0.1cb 300 tf ns set-up time for stop condition 4.0 0.6 t su : sto ns capacitive load for each bus line 400 400 cb pf
st72774/st727754/st72734 138/144 notes : C rl is the load connected on the usb drivers. C all the voltages are measured from the local ground potential (usbgnd). figure 78. usb: data signal rise and fall time note1 : measured from 10% to 90% of the data signal usb dc electrical characteristics parameter symbol conditions min. max. unit inputs levels: differential input sensitivity vdi absi((d+) - (d-)) 0.2 v differential common mode range vcm includes vdi range 0.8 2.5 v single ended receiver threshold vse 0.8 2.0 v output levels static output low vol rl of 1.5k ohms to 3.6v 0.3 v static output high voh rl of 15k ohms to usbgnd 2.8 3.6 v usbvcc: voltage level usbv v dd =5v 3 3.6 v differential datas lines usbgnd tf tr crossover points vcrs usb: low speed electrical characteristics parameter symbol conditions min max unit driver characteristics: rise time tr note 1, cl=50 pf 75 ns note 1, cl=600 pf 300 ns fall time tf note 1, cl=50 pf 75 ns note 1, cl=600 pf 300 ns rise/ fall time matching trfm tr/tf 80 120 % output signal crossover voltage vcrs 1.3 2.0 v
st72774/st727754/st72734 139/144 7 general information 7.1 package mechanical data figure 79. 42-pin shrink plastic dual in-line package, 600-mil width figure 80. 42-pin shrink ceramic dual in-line package, 600-mil width dim. mm inches min typ max min typ max a 5.08 0.200 a1 0.51 0.020 a2 3.05 3.81 4.57 0.120 0.150 0.180 b 0.46 0.56 0.018 0.022 b2 1.02 1.14 0.040 0.045 c 0.23 0.25 0.38 0.009 0.010 0.015 d 36.58 36.83 37.08 1.440 1.450 1.460 e 15.24 16.00 0.600 0.630 e1 12.70 13.72 14.48 0.500 0.540 0.570 e 1.78 0.070 ea 15.24 0.600 eb 18.54 0.730 ec 0.00 1.52 0.000 0.060 l 2.54 3.30 3.56 0.100 0.130 0.140 number of pins n42 pdip42s dim. mm inches min typ max min typ max a 4.01 0.158 a1 0.76 0.030 b 0.38 0.46 0.56 0.015 0.018 0.022 b1 0.76 0.89 1.02 0.030 0.035 0.040 c 0.23 0.25 0.38 0.009 0.010 0.015 d 36.68 37.34 38.00 1.444 1.470 1.496 d1 35.56 1.400 e1 14.48 14.99 15.49 0.570 0.590 0.610 e 1.78 0.070 g 14.12 14.38 14.63 0.556 0.566 0.576 g1 18.69 18.95 19.20 0.736 0.746 0.756 g2 1.14 0.045 g3 11.05 11.30 11.56 0.435 0.445 0.455 g4 15.11 15.37 15.62 0.595 0.605 0.615 l 2.92 5.08 0.115 0.200 s 0.89 0.035 number of pins n42 cdip42sw 8
st72774/st727754/st72734 140/144 figure 81. 44-pin thin quad flat package dim mm inches min typ max min typ max a 1.60 0.063 a1 0.05 0.15 0.002 0.006 a2 1.35 1.40 1.45 0.053 0.055 0.057 b 0.30 0.37 0.45 0.012 0.015 0.018 c 0.09 0.20 0.004 0.008 d 12.00 0.472 d1 10.00 0.394 d3 8.00 0.315 e 12.00 0.472 e1 10.00 0.394 e3 8.00 0.315 e 0.80 0.031 k 0 3.5 7 l 0.45 0.60 0.75 0.018 0.024 0.030 l1 1.00 0.039 number of pins n 44 b c l1 l k 0.10mm .004 seating plane
st72774/st727754/st72734 141/144 8 ordering information the following section deals with the procedure for transfer of customer codes to stmicroelectronics. 8.1 transfer of customer code customer code is made up of the rom contents and the list of the selected mask options (if any). the rom contents are to be sent on diskette, or by electronic means, with the hexadecimal file in .s19 format generated by the development tool. all unused bytes must be set to 9dh (opcode for nop). the selected mask options are communicated to stmicroelectronics using the correctly completed option list appended. the stmicroelectronics sales organization will be pleased to provide detailed information on contractual points. figure 82. sales type coding rules table 35. development tools 1 xx stands for the power supply code assigned by st microelectronics: eu=220v; us=110v development tool sales type remarks real time emulator st727x4-emu2b eprom programmer board st727x4-epb/xx 1 220v power supply eu 110v power supply us gang programmer st72e774-gp/d42 st72e774-gp/q44 dil42 pqfp44 st72 t 7x4 j 7 b 1 / xxx family version code subfamily (with x=subset index) number of pins rom size package temperature range rom code (three letters) 0 = 25 c b = plastic dip 9 = 60k j = 42 pins no letter = rom 1 = standard (0 to +70c) d = ceramic dip 7 = 48k s = 44 pins e = eprom t = plastic qfp 6 = 32k t = otp
st72774/st727754/st72734 142/144 table 36. ordering information (1) 8 bit 2 lsb a/d converter (2) 8 bit 4 lsb a/d converter sales type rom/eprom (bytes) ram (bytes) tmu usb package st72x774 (1) st72e774j9d0 60k eprom 1k yes yes csdip42 st72t774j9b1 60k otp psdip42 st72774j9b1/xxx 60k rom st72774j7b1/xxx 48k rom st72774s7t1/xxx 48k rom tqfp44 st72t774s9t1 60k otp st72774s9t1/xxx 60k rom st72x754 (1) st72e754j9d0 60k eprom 1k yes no csdip42 st72t754j9b1 60k otp psdip42 ST72754j9b1/xxx 60k rom ST72754j7b1/xxx 48k rom st72t754s9t1 60k otp tqfp44 ST72754s9t1 60k rom ST72754s7t1/xxx 48k rom st72x734 (2) st72e734j6d0 32k eprom 512 no no csdip42 st72t734j6b1/xxx 32k otp psdip42 st72734j6b1/xxx 32k rom
st72774/st727754/st72734 143/144 stmicroelectronics option list st727x4 microcontroller family customer: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . address: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . contact: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . phone no: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . reference/rom code* : . . . . . . . . . . . . . . . . . . . *the rom code name assigned by st. stmicroelectronics reference: special marking: [ ] no [ ] yes "_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _" for marking, one line is possible with maximum 16 characters for sdip42 and 10 characters for tqfp44. authorized characters are letters, digits, '.', '-', '/' and spaces only. mask options: none. we have checked the rom code verification file returned to us by stmicroelectronics. it conforms exactly with the rom code file orginally supplied. we therefore authorize stmicroelectronics to proceed with device manufacture. signature . . . . . . . . . . . . . . . . . . . . . . . . . . . . . date . . . . . . . . . . . . . . . . . . . . . . . . . . . . . device (sdip42): [ ] st72774j9b1 (60k rom) [ ] st72774j7b1 (48k rom) [ ] ST72754j9b1 (60k rom) [ ] ST72754j7b1 (48k rom) [ ] st72734j6b1 (32k rom) device (tqfp44): [ ] st72774s9t1 (60k rom) [ ] st72774s7t1 (48k rom) [ ] ST72754s9t1 (60k rom) [ ] ST72754s7t1 (48k rom) device (csdip42): [ ] st72e774j9d0 (60k eprom) [ ] st72e754j9d0 (60k eprom) [ ] st72e734j6d0 (32k eprom) software development: [ ] stmicroelectronics [ ] customer [ ] external laboratory
information furnished is believed to be accurate and reliable. however, stmicroelectronics assumes no responsibility for the co nsequences of use of such information nor for any infringement of patents or other rights of third parties which may result from its use. no license is granted by implication or otherwise under any patent or patent rights of stmicroelectronics. specifications mentioned in this publicati on are subject to change without notice. this publication supersedes and replaces all information previously supplied. stmicroelectronics prod ucts are not authorized for use as critical components in life support devices or systems without the express written approval of stmicroele ctronics. the st logo is a registered trademark of stmicroelectronics ? 2003 stmicroelectronics - all rights reserved. purchase of i 2 c components by stmicroelectronics conveys a license under the philips i 2 c patent. rights to use these components in an i 2 c system is granted provided that the system conforms to the i 2 c standard specification as defined by philips. stmicroelectronics group of companies australia - brazil - china - finland - france - germany - hong kong - india - italy - japan - malaysia - malta - morocco - sin gapore - spain sweden - switzerland - united kingdom - u.s.a. http://www.st.com 9


▲Up To Search▲   

 
Price & Availability of ST72754

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X